Turn off Computer

BlitzPlus Forums/BlitzPlus Programming/Turn off Computer

Petron(Posted 2006) [#1]
Does anyone have code that turnes off your computer? If you do can you post it of post a link if it is already posted. Thanks


Alaric(Posted 2006) [#2]
ExecFile("Shutdown.exe -s -c "+Chr$(34)+"Because I said so"+Chr$(34)+" -d p -t 10") That starts up a program in dos that should shut down the computer. The chr$(34)'s represent quotation marks (which are kind of hard to add in in blitz without that command).


Petron(Posted 2006) [#3]
Is there a way to terminate this action so the computer doesn't turn off?


SebHoll(Posted 2006) [#4]
Yeah, use ExecFile("Shutdown.exe -a") to abort shutdown. Bear in mind however, that this command will only work on Windows XP.


Petron(Posted 2006) [#5]
Thanks Seb, is there a list of different system commands like this?


Petron(Posted 2006) [#6]
I need someone to post what the different commands in the code line that turns off your computer do. Like the "-s". I got rid of it and it screwed up my computer I had to restart it to get anything to work right.


mindstorms(Posted 2006) [#7]
This code archive entry has them.
http://www.blitzbasic.com/codearcs/codearcs.php?code=1195


Petron(Posted 2006) [#8]
Thank you all for your help


andy_mc(Posted 2007) [#9]
I'm not sure writing a game that turns the players PC off is such a good idea!?!? (jk)


Petron(Posted 2007) [#10]
If they cheat they will be punished.

(Joking) I will not put that in a real game, I use it just for fun.