I am trying to run the below batch script using PHP (it runs fine from command prompt) to change the IP using the argument passed
@echo off
setlocal enabledelayedexpansion
netsh int ip set address "EDU_LAN_Connection" static 172.31.%1.110 255.255.255.0 172.31.%1.1 1
In PHP:
system("cmd /c C:\EDU_Project\change_ip.bat 6");
I get the following error when running the PHP script:
Invalid address parameter (172.31.61.1 1). It should be a valid IPv4 address.
I am not sure how to use delayedexpansion with argument. Please help !