I am trying to execute a netsh command from my php application using shell_exec. I get the following error:
The following command was not found: "interface ip set address name="Local Area Connection" static 192.168.44.133 255.255.255.0 192.168.44.1".
My code is as follows:
// Set the IP settings using netsh.
echo shell_exec('netsh "interface ip set address name=\"Local Area Connection\" static ' .
$strIPAddress . ' ' .
$strSubnetMask . ' ' .
$strDefaultGateway . '"');
It is worth mentioning that I can execute other applications using shell_exec so it doesn't seem to be anything to do with my php.ini settings.
I am thinking it might be a permissions thing as the exact same command works when executing it in netsh, i.e. it changes the ip address and doesn't error.
I have also tried specifying the location of the netsh.exe and running it like that.
Please any advice would be greatly appreciated.
Thanks