I need to access a Linux machine from Windows 7 via PHP.
For that I created simple bat (MyScript.bat
) script containing plink.
c:\wamp\www\abc\plink.exe user1@192.168.70.128 -pw l1c -C "df -h">11.txt
When I am executing the bat script, it's working fine, i.e. the output is written in file 11.txt
But when I am accessing it from PHP, the 11.txt
is created without data
echo exec('MyScript.bat');
Moreover, in browser, the script commands are displayed as text. I even tried to use print_r
for the display.
"c:\wamp\www\abc\plink.exe user1@192.168.70.128 -pw l1c -C "df -h">11.txt