Call nbtstat command from PHP (64-bit OS)
I am trying to call a command nbtstat
from PHP using shell_exec()
. Apparently it doesn't work because I am using a 64 bit system.
echo shell_exec("nbtstat");
I have done some research and it seems the issue is with Windows 64-bit defaulting to \Windows\SysWOW64
like System32
. But it nbtstat
is in a regular folder \Windows\System32
.
In normal applications, you can call Wow64DisableWow64FsRedirection
to disable this redirection, but I haven't been able to find this in PHP yet.
Is there a way to call these commands from PHP on a 64-bit operating system?
Add "\ Windows \ Sysnative" to the end of your environment path.
What you need to do is grant IUSR_<machinename>
read and execute / read permissions to users not on the file C:\WINDOWS\SysWOW64\nbtstat.exe
, but on the file C:\WINDOWS\SYSTEM32\nbtstat.exe
.