1. <? Php
2 ./**
3. * remotely start the computer
4. * Note: iis/apache requires windows/system/cmd.exe execution permission.
5 .*
6 .**/
7. if (isset ($ _ POST ['cmd']) {
8. $ cmd = stripslashes ($ _ POST ['cmd']);
9. exec ($ cmd, $ out );
10. var_dump ($ out );
11. echo '<br> ';
12. var_dump ($ cmd );
13.} else {
14.?>
15. <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
16. <form action = "index. php" method = "post" name = "form0" id = "form0">
17. <p> </p>
18. <p align = "center"> CMD </p>
19. <table width = "200" border = "0" align = "center">
20. <tr>
21. <td width = "81" height = "18"> select: </td>
22. <td width = "109"> <select name = "cmd">
23. <option value = "shutdown-r" selected = "selected"> restart the computer </option>
24. <option value = "shutdown-s"> disable the computer </option>
25. <option value = "shutdown-l"> log out of the current user </option>
26. </select> </td>
27. </tr>
28. <tr>
29. <td> </td>
30. <td> <input type = "submit" name = "Submit" value = "submit"/> </td>
31. </tr>
32. </table>
33. <p> </p>
34. </form> www.2cto.com
35. <? Php
36 .}
37.?>