The Quick Shutdown (QSD) tool helps you perform a
system shutdown interactively or from the command line. You could use
this tool to perform a specific kind of shutdown from a batch file or
script after performing a maintenance action. In most respects, QSD is
simply a more functional version of the ShutDown utility provided with
Windows XP and above. To use the interactive form of this utility,
simply look for the icon in the Taskbar tray. You can download this tool
at http://www.winutility.com/qsd/. This utility uses the following syntax:
qsd.exe [-f] [-s] [-r] [-l] [-h] [-d] [-k] [-e:x:]
The following list
describes each of the command line arguments.
-f
Forces
all of the running applications to exit immediately, instead of giving
them time to save their data. You can use this feature when you need to
shut down the computer for emergency reasons, such as a circuit
meltdown. However, using this option may mean data loss. Make sure the
emergency is real.
-s
Shuts down the
computer normally. All of your applications will have time to save data
and settings. This option results in a power down of the computer. If
you simply need to reboot the computer to add new drivers or DLLs, then
use the -r command line switch instead.
-r
Reboots the
computer. The computer will go through an entire soft boot cycle. After
the boot process completes, you can log back into the system and resume
computing.
-l
Logs the current
user off the system. The machine doesn't reboot. You can accomplish some
types of file replacement installations simply by logging off the
existing user and asking them to log back into the system. This feature
also lets you create batch files where you switch between users to
accomplish specific tasks.
-h
Places the
computer in hibernation mode. The system remains on and the user remains
logged into the system. The system restores the current setup when the
user performs the task required to remove the system from the hibernate
state, such as moving the mouse or pressing a button on the keyboard.
-d
Places the
computer in standby mode.
-k
Locks the
workstation. The user is still logged into the system, but has to supply
a username and password to unlock the workstation. You would use this
feature when the user goes to lunch or to a meeting.
-e:x:
Ejects
removable media from the system. You must supply the letter of the drive
to eject.
Not
All Utilities Run as Expected
The command line as it
appears in most versions of Windows is the same command line that
originally appeared in DOS. (Vista, Windows 2008 Full version, and
Server Core do place additional security restraints on the command
line.) Yes, the command line today supports additional utilities, but
even the old DOS utilities are available on Windows. In short,
apparently nothing is new. However, appearances can be deceiving. The
Windows command line doesn't rely on the older command processor, Command.EXE; it relies on a new command processor, CMD.EXE, instead. In addition, the Windows command line
does provide access to a wealth of new utilities and it places
limitations on how utilities work. The limitations are going to cause
you grief when working with some utilities.
In order to
provide a safe environment for your applications to run, the Windows
command line must make some assumptions about the utilities. For
example, a utility can't use certain low-level function calls because
they would interrupt other applications or make the environment
unusable. Unfortunately, Microsoft doesn't display a message box every
time a utility violates one of these rules. The only thing that will
happen is that the utility will fail—apparently for no reason at all.
The only way for you to ensure that the utility works as anticipated is
to view Microsoft's rules and then ensure the utility doesn't violate
any of them. You can find a list of these rules at http://support.microsoft.com/default.aspx?scid=kb;en-us;Q314106.