Portal Home > Knowledgebase > Articles Database > Exec Command via PHP - Win2003
Exec Command via PHP - Win2003
Posted by CleberDantas, 08-04-2009, 01:47 PM |
Hello,
I created .php in my site for send command in workstation in domain.
If i use, work normal:
system("ping server");
?>
If i use, no work and no receive error message:
system("psexec.exe -u cpd -p 123 \\suporte c:\1.bat");
?>
If i create .bat and this command, work normal.
What possible problem?
|
Posted by sam0, 08-04-2009, 03:34 PM |
You may have to use the full path to psexec.exe.
Also you shouldn't use short tags, use ' |
Posted by CleberDantas, 08-04-2009, 10:26 PM |
Thanks.
No worked and no received error or other message.
|
Posted by CleberDantas, 08-05-2009, 03:14 PM |
Hello. Up.
|
Posted by CleberDantas, 08-06-2009, 04:06 PM |
In linux i use command for reboot workstation XP:
net rpc shutdown -r -f -I 192.168.116.166 -U cpd%123
I want exec this command in php, but no work.
I used:
No work, no receive message or error in php. If i use commando ping, work normal.
What problem?
|
Posted by sam0, 08-06-2009, 10:55 PM |
Are you using echo? echo system() or echo exec().
|
Posted by CleberDantas, 08-07-2009, 09:40 AM |
Hello!
I tested with echo and no receive any message.
|
Posted by sam0, 08-07-2009, 03:09 PM |
Works fine for me in vista, does it work for you? And does it work for your shutdown cmd?
|
Posted by CleberDantas, 08-08-2009, 09:08 PM |
Received this message and no worked.
'';
system('net rpc shutdown -r -f -I 192.168.116.166 -U cpd%123');
'';
|
Posted by CleberDantas, 08-08-2009, 09:10 PM |
php?
system('net rpc shutdown -r -f -I 192.168.116.166 -U cpd%123');
?>
If use this site and set ping command, work normal.
|
Add to Favourites Print this Article
Also Read