Blitz Plus only
Code archives/BlitzPlus Gui/Simple System Commands
This code has been declared by its author to be Public Domain code.
Download source code
| Simple system commands restart, logoff, and shutdown. The code is short but it does what is needed. Enjoy |
window=CreateWindow( "System",0,0,192,56,0,1 ) button=CreateButton( "Turn Off",0,0,64,24,window ) buttona=CreateButton( "Log Off",64,0,64,24,window ) buttonb=CreateButton( "Restart",128,0,64,24,window ) While WaitEvent()<>$803 If EventID()=$401 If EventSource()=button Then ExecFile("Shutdown.exe -s") If EventSource()=buttona Then ExecFile("Shutdown.exe -l") If EventSource()=buttonb Then ExecFile("Shutdown.exe -r") EndIf Wend End |
Comments
Windows XP only...
SP1 and higher only ...
My Bad
Use shutdown.exe -a to stop the shutdown process
with shutdown.exe -t XX (XX = time in seconds) you can edit the countdowntime. With shutdown.exe -f you can kill applications.
with shutdown.exe -t XX (XX = time in seconds) you can edit the countdowntime. With shutdown.exe -f you can kill applications.