PHP shell_exec command not working in Windows -
i have following code doesn't seem work, works when open command prompt , run command:
<!doctype html> <html> <head> </head> <body> <form action="ping.php" method="post"> <label for="pc_number">provide target pc names (separate ":"): </label> <input type="text" name="pc_number" id="pc_number"> <input type="submit"> </form> <?php if(empty($_post["pc_number"])==false) { $number = explode(":", $_post["pc_number"]); foreach($number $pc) { $restart = shell_exec("shutdown /r /m {$pc} /t 0"); echo "restarting {$pc}... <br>\n"; echo $restart; } } ?> </body>
how come works in command prompt not when execute via php? trying restart windows pc remotely.
Comments
Post a Comment