Command to reboot?

A

Anonymous

Guest
Is there any sort of PHP code that can be used to reboot a windows machine? I have done some investigation and have found the answer to be no so far.

I would like to write a script that allows me to remotely shutdown my server, and would prefer not to spend and $$ on software that can do it.


Thanks,

Fribbles
 
PHP's exec() function allows you to run a program (assuming the program is on the same computer as the server). Windows XP comes with a handy shutdown.exe program. To learn more about shutdown.exe, open a command prompt (Start > Run > "cmd") and type "shutdown" (don't worry, it won't shutdown your computer if you don't type any parameters after it). So basically, what you'd do is:

Code:
<?php
   exec('shutdown -s");
?>
 
Am trying to use the exec() to start a program on my server if I am in a remote location. Have used the exec("shutdown -r"); and it works well however if I try to run a program as such


exec("c:\\SID_PAGE\\CellemetryTCPApp.exe");

or


exec("c:\SID_PAGE\CellemetryTCPApp.exe");

The page just loads extremelly slowly and will not work. The program's GUI doesnt show up on the server and it seems that nothing happens. Any help is appreciated.
 
In addition I am looking for a command that will close and individual running application, cause if I am to rerun this app I will need to kill the prior one before. Any suggestions?
 
Windows it's not unix/linux, but if you create programm what see all process and may kill some....
or use Windows API, i think what some solution you may find
 
My suggestion, Fribbles, is Google. All you need is a program that can do these things via command line parameters, and there are many such programs out there. Happy Hunting!
 
Back
Top