angadsingh007 Posted February 25, 2005 Posted February 25, 2005 HOW-TO GUIDE ON SHUTDOWN, REBOOT & LOGOFF COMMANDSFOR WINDOWS (ALL) AND DOSAll of us are aware of the "shutdown" command in Windows XP and above, which provides us not only with the option of shutting down silently, but logging off, restarting, and other stuff- like displaying the reason for shutdown or setting a time-delay before shutdown... But, here are a lot of other ways of doing this in other version of windows and even in the pure DOS environment:
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 DOSCommand Line: ECHO G=FFFF:0000 ¦ DEBUGEffect : RebootRemarks : Warm boot, sometimes cold boot.May not work with "exotic" memory managers, like Quarterdeck's QEMM or DesqView; in that case, use REBOOT.COM (get it here)
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows 3.1, 3.11 or 3.11 for WorkgroupsCommand Line: ECHO G=FFFF:0000 ¦ DEBUGEffect: Task Manager popupRemarks: And sometimes reboot
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows 95 or 98Command Line : RUNDLL USER.EXE,ExitWindowsEffect : Shutdown -----------------------------------------------------------------------Command Line : RUNDLL USER.EXE,ExitWindowsExecRemarks : Win95: various results, usualy fast shutdown (and lock PC), sometimes restart Windows, sometimes reboot.Win98: Restart Windows, sometimes reboot.-----------------------------------------------------------------------Command Line : RUNDLL SHELL.DLL,RestartDialogEffect : Restart dialogRemarks : "System Settings Changed, Do you want to restart your computer now?" dialog
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows 98Command Line : RUNDLL32 KRNL386.EXE,exitkernelEffect : PoweroffRemarks : Poweroff for ATX boards only, otherwise normal shutdown-----------------------------------------------------------------------Command Line: RUNDLL32 SHELL32.DLL,SHExitWindowsEx nEffect : n can be any combination (sum) of the following numbers: (4)0 Logoff1 Shutdown2 Reboot4 Force8 Poweroff (if supported by the hardware)-----------------------------------------------------------------------Command Line : RUNONCE.EXE -qEffect : Reboot
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows NT4Command Line : RUNDLL32 USER32.DLL,ExitWindowsExRUNDLL32 USER32.DLL,ExitWindowsExEffect : LogoffRemarks : Most systems require the command to be called twice before logging off
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 NT4+RK, W2K+RKCommand Line : SHUTDOWN /L /R /T:0 /YEffect : RebootRemarks : Immediate shutdown & reboot-----------------------------------------------------------------------Command Line : SHUTDOWN /L /T:10 /Y /CEffect : Delayed shutdownRemarks : Shutdown in 10 seconds, close without saving.Can be stopped during those 10 seconds using SHUTDOWN /A
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows NT 4, 2000 or XPCommand Line : PSSHUTDOWN \\mynt4srv -K -F -T 20 Effect : Delayed poweroffRemarks :Poweroff \\mynt4srv after a 20 seconds delayCan be aborted using PSSHUTDOWN \\mynt4srv -A -----------------------------------------------------------------------Command Line : PSSHUTDOWN \\myw2ksrv -O -F -T 0 Effect : LogoffRemarks :Immediately logoff console user on \\myw2ksrv-----------------------------------------------------------------------Command Line : DEVCON RebootEffect : Reboot
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows XP/Server 2003Command Line : SHUTDOWN -r -t 10Effect : Delayed rebootRemarks :Reboot after a 10 seconds delay.Can be stopped during those 10 seconds using SHUTDOWN -a-----------------------------------------------------------------------Command Line : SHUTDOWN -s -t 01Effect : Delayed shutdownRemarks : Shutdown after a 1 second delay, NO poweroff.
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows NT 4 Terminal Server Edition or Windows 2000 (Advanced) Server with Terminal Server installedCommand Line : LOGOFF 16 /SERVER:termserv1Effect : LogoffRemarks : Logoff session 16 on Terminal Server TERMSERV1.Use the QUERY USER command to find out which session ID belongs to whom.-----------------------------------------------------------------------Command Line : TSSHUTDN 45 /SERVER:termserv1 /POWERDOWN /DELAY:20 /VEffect : Delayed poweroffRemarks :Notify all users on Terminal Server TERMSERV1, logoff all Terminal Server sessions after 45 seconds, wait another 20 seconds, and then shut down Terminal Server TERMSERV1 and power off.
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Perl (Requires ActivePerl)Command Line : InitiateSystemShutdown( $sComputer, $sMessage, $uTimeoutSecs, $bForce, $bReboot )Effect : Comprehensible by looking at the code-----------------------------------------------------------------------Command Line : InitiateSystemShutdown( "", "", 0, 1, 1 )Effect : RebootRemarks : Immediate reboot without message, force applications to close without saving data-----------------------------------------------------------------------Command Line : InitiateSystemShutdown( "", "Going down...", 10, 0, 1 )Effect : Delayed rebootRemarks : Reboot after 10 seconds, with message and without forcing applications to close-----------------------------------------------------------------------Command Line : InitiateSystemShutdown( "10.0.1.16", "Sorry", 5, 1, 0 )Effect : Delayed shutdownRemarks : Shutdown of remote computer after 5 seconds, with message and forced closing of applications
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Windows Scripting Host (included in Windows 2k/NT/XP, installable on Windows 98/ME)Command Line : [1] Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")[2][3] for each OpSys in OpSysSet[4] OpSys.Reboot()[5] nextEffect : RebootRemarks : Requires WMI.Remove [line numbers].-----------------------------------------------------------------------Command Line : Replace line 4 in the script above with this one:[4] OpSys.Shutdown()to shut down the PC instead of rebooting it.Effect : ShutdownRemarks : But no poweroff.-----------------------------------------------------------------------Command Line : [1] Const EWX_LOGOFF = 0[2][3] Set wmi = GetObject("winmgmts:{(Shutdown)}")[4] Set objSet = wmi.InstancesOf("Win32_OperatingSystem")[5][9] For Each obj in objSet[6] Set os = obj[7] Exit For[8] Next[9][10] os.Win32Shutdown EWX_LOGOFFEffect : LogoffRemarks : Requires WMI.Remove [line numbers].
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Conclusion : Use Andrej Budja's XP Shutdown replacement if you want to poweroff your computer from the command line.Didier Cassereau's Logoff tool for Windows NT can logoff, shutdown, reboot or power off from the command line.Jorgen Bosman's PowerOff for all Windows (32-bits) versions can power off, shutdown or reboot your PC, log you off, lock your workstation, go to standby or hibernation mode and even wake up another PC.All actions can be done locally or on a remote PC (if it is running PowerOff).The actions can be performed immediately or scheduled, by using its built-in scheduler.This tool can be used both as a GUI or as a command line tool.Gibson Research's Wizmo is a collection of tools integrated in a single package.Among its functions are shutdown, reboot, hibernate and logoff.And last but not least SysInternals.com's PSSHUTDOWN can perform logoffs, poweroffs, shutdowns and reboots on both local and remote Windows NT 4/2000/XP systems. Absolutely recommended. FLames // Suggestions // Comments Welcome
angadsingh007 Posted February 25, 2005 Author Posted February 25, 2005 Guide now complete-every version of windows-all files now up
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now