cry of war Posted January 2, 2008 Share Posted January 2, 2008 I was wondering if there was a way of using the CMDs Remote shutdown "Shutdown -s -t 0 -c 'Good bye' -f "with php i have seen that i might be able to do it with python but i dont know anything about that any other suggestions? And for all i know there might not even be a way to do this Quote Link to comment https://forums.phpfreaks.com/topic/84105-solved-shell-commands-and-php/ Share on other sites More sharing options...
trq Posted January 2, 2008 Share Posted January 2, 2008 Take a look at exec and its related functions. Quote Link to comment https://forums.phpfreaks.com/topic/84105-solved-shell-commands-and-php/#findComment-428123 Share on other sites More sharing options...
cry of war Posted January 2, 2008 Author Share Posted January 2, 2008 took a bit of reading but i figured it out thanks thorpe.. heres my code hack.php <?PHP $hack="1"; if ($hack==1) { exec("bat.bat");} ?> bat.bat @ECHO OFF SHUTDOWN -S -T 30 -C "GOOD BYE" -F Quote Link to comment https://forums.phpfreaks.com/topic/84105-solved-shell-commands-and-php/#findComment-428129 Share on other sites More sharing options...
Daniel0 Posted January 2, 2008 Share Posted January 2, 2008 You can just pass it directly to exec(). I.e. exec('SHUTDOWN -S -T 30 -C "GOOD BYE" -F'); Quote Link to comment https://forums.phpfreaks.com/topic/84105-solved-shell-commands-and-php/#findComment-428131 Share on other sites More sharing options...
cry of war Posted January 2, 2008 Author Share Posted January 2, 2008 tried that it didnt want to work for some reason thats why it took me so long a first... Any one know why it doesnt work when i try to host it is this kind of thing most servers like to block? Quote Link to comment https://forums.phpfreaks.com/topic/84105-solved-shell-commands-and-php/#findComment-428135 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.