Advertisement
5_2007-2008 Miscellaneous #185124

AA Very Easy Shutdown Methods for Novice Users

Allows a novice user to shutdown/restart/log off/force shutdown with or without a specific time length his/her computer with a simple one line of code

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
<b> Shutting down the computer in Visual Basic </b>
There are different commands you can give to shut down the computer.
Type thiese in any procedure e.g. Command1.Click() <br><br>
<b>To Log off: </b> <br>
 retval=shell("RUNDLL32 SHELL32.DLL,SHExitWindowsEx 0",1) <br> <br>
<b>To Shut Down: </b> <br>
 retval=shell("RUNDLL32 SHELL32.DLL,SHExitWindowsEx 1",1) <br> <br>
<b>To Reboot: </b>
 retval=shell("RUNDLL32 SHELL32.DLL,SHExitWindowsEx 2",1) <br> <br>
<b>To Force ShutDown: </b>
 retval=shell("RUNDLL32 SHELL32.DLL,SHExitWindowsEx 4") <br> <br>
The above code can also be inserted into timer so the computer shutdowns after a period of time. <br>
However, if you are a complete novice and use Windows Xp, then use the following code: <br> <br>
retval=shell("SHUTDOWN /L /T:15 /Y /C",1) <br> <br>
The above code will shutdown in 15 seconds, and close all existing programs without saving. <br>
If however you wish to stop the shutdown during these 15 seconds, then a simple ccommand: <br> <br>
retval=shell("shutdown /a",1) <br> <br>
should suffice. Note that the 15 seconds can be adjusted to seconds of your choice. Insert /n instead of /y for prompt to save exisiting applications and remove the final parameter /c if you do not want shutdown to be cancelled.
Hope the above Article helps you in understanding in different ways to shutdown. <br>
Please, please, please vote for me! It is my first submission
Original Comments (3)
Recovered from Wayback Machine