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 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. 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 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'); 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? 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
Archived
This topic is now archived and is closed to further replies.