Call netsh command using PHP
<p>I am trying to execute a netsh command from my php application using shell_exec. I get the following error:</p>

<p>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".</p>

<p>My code is as follows:</p>

<pre><code>    // Set the IP settings using netsh.
    echo shell_exec('netsh "interface ip set address name=\"Local Area Connection\" static ' . 
                    $strIPAddress . ' ' . 
                    $strSubnetMask . ' ' .
                    $strDefaultGateway . '"');
</code></pre>

<p>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.</p>

<p>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.</p>

<p>I have also tried specifying the location of the netsh.exe and running it like that. </p>

<p>Please any advice would be greatly appreciated.</p>

<p>Thanks</p>
