List of Run Commands in Windows 7 Program Name Run Command
List of Run Commands in Windows 7 Program Name Run Command
s
SC Service Control
SCHTASKS Schedule a command to run at a specific time
SCLIST Display Services
SET Display, set, or remove session environment
variables
SETLOCAL Control the visibility of environment variables
SETX Set environment variables
SFC System File Checker
SHARE List or edit a file share or print share
ShellRunAs Run a command under a different user account
SHIFT Shift the position of batch file parameters
SHORTCUT Create a windows shortcut (.LNK file)
SHOWGRPS List the Workgroups a user has joined
SHOWMBRS List the Users who are members of a Workgroup
SHUTDOWN Shutdown the computer
SLEEP Wait for x seconds
SLMGR Software Licensing Management (Vista/2008)
SOON Schedule a command to run in the near future
SORT Sort input
START Start a program, command or batch file
SU Switch User
SUBINACL Edit file and folder Permissions, Ownership and
Domain
SUBST Associate a path with a drive letter
SYSTEMINFO List system configuration
t
TAKEOWN Take ownership of a file
TASKLIST List running applications and services
TASKKILL Remove a running process from memory
TIME Display or set the system time
TIMEOUT Delay processing of a batch file
TITLE Set the window title for a CMD.EXE session
TLIST Task list with full path
TOUCH Change file timestamps
TRACERT Trace route to a remote host
TREE Graphical display of folder structure
TSDISCON Disconnect a Remote Desktop Session
TSSHUTDN Remotely shut down or reboot a terminal server
TYPE Display the contents of a text file
TypePerf Write performance data to a log file
u
USRSTAT List domain usernames and last login
v
VER Display version information
VERIFY Verify that files have been saved
VOL Display a disk label
w
WAITFOR Wait for or send a signal
WHERE Locate and display files in a directory tree
WHOAMI Output the current UserName and domain
WINDIFF Compare the contents of two files or sets of files
WINMSDP Windows system report
WINRM Windows Remote Management
WINRS Windows Remote Shell
WMIC WMI Commands
WUAUCLT Windows Update
x
XCACLS Change file and folder permissions
XCOPY Copy files and folders
:: Comment / Remark
How many users are logged on/connected to a server (and who are they)?
Who is logged on to a computer?
What is this collegue's login name?
What is the full name for this login name?
What groups is this user a member of?
What permissions does a user have on this directory?
When did someone last change his password?
How do I reset someone's password?
Is someone's account locked?
How to unlock a locked account
Make sure a local user's password never expires
Make sure a local user's password will expire
List all domains and workgroups in the network
List all computers in the network
List all domain controllers
Find the primary domain controller
List all member servers
List all workstations
Delete a computer account
"I need an up-to-date list of disk space usage for all servers, on my desk in
5 minutes"
List all drivers on any PC
List all printers on any PC
List all local administrators
Locate rogue DHCP servers
Disable Windows Firewall for domain only
Completely disable Windows Firewall (not recommended)
Is IP v4 supported on this computer?
Is IP v6 supported on this computer?
Which updates were installed on this compter?
Sometimes we may need to know how many users are logged on to a (file) server, like
maybe when there is a performance degradation.
At the server's console itself, with native commands only:
NET SESSION | FIND /C "\\"
This is arguably the most reliable (native) command to find out who is logged on.
or:
PSEXEC \\remotecomputer NET CONFIG WORKSTATION | FIND /I "
name "
or:
PSEXEC \\remotecomputer NET NAME
or for Windows 7:
FOR /F %%A IN ('REG Query \\remotecomputer\HKU /K /F "S-1-
5-21-" | FINDSTR /R /B /C:"HKEY_USERS\\S-1-5-[0-9][0-9]-[0-9-
]*$"') DO (') DO (
FOR /F "tokens=2*" %%B IN ('REG Query
"\\remotecomputer\%%~A\Volatile Environment" /V "UserName" |
FIND /V ":"') DO (
SET LoggedinUser=%%C
)
)
NETSH and WMIC are for XP or later, and are the most reliable of all commands shown
here.
WMIC requires WMI enabled remote computers and Windows XP on the administrator's
computer; NETSH requires Windows XP on the local and remote computers.
PSLOGGEDON is a more accurate solution than NBTSTAT, but it will return the last logged
on user if no one is currently logged on.
The NET and NBTSTAT commands show more or less identical results, but the NBTSTAT
command is much faster.
The REG command is accurate, but may need to be modified depending on the version
used.
More information on REG versions can be found on my REG Query page.
For Windows NT 4 and 2000: use NBTSTAT (fast, but it won't always return the user
name!), and only switch to REG if NBTSTAT doesn't return a user name (modify the REG
command for Windows NT 4).
For Windows XP and later: if you want to search lots of computers for logged on users, I
recommend you try NBTSTAT first (fast, but it won't always return the user name!), and
only switch to NETSH, REG or WMIC (accurate) if NBTSTAT doesn't return a user name.
My collegues often forget to mention their logon account name when calling the helpdesk,
and the helpdesk doesn't always ask either. I suppose they expect me to know all 1500+
accounts by heart.
With (native) Windows Server 2003 commands only:
DSQUERY USER -name *lastname* | DSGET USER -samid -display
Note: Windows Server 2003's "DSTools" will work fine in Windows 2000 and XP too, when
copied.
Keep in mind, however, that some Windows Server 2003 Active Directory
functionality is not available in Windows 2000 Active Directories.
Back to the index
In Windows NT 4 and later, users usually are members of global groups. These global
groups in turn are members of (domain) local groups. Access permissions are given to
(domain) local groups.
To check if a user has access to a resource, we need to check group membership
recursively.
With (native) Windows Server 2003 commands:
DSQUERY USER -samid loginname | DSGET USER -memberof -
expand
or, if you prefer host names only (tip by Jim Christian Flatin):
DSQUERY Server -o rdn
or, to find the FSMO with (native) Windows Server 2003 commands (Active Directory only):
NETDOM QUERY /D:mydomain.com FSMO
NETDOM is part of the support tools found in the \SUPPORT directory of the Windows 2000
installation CDROM.
"I need an up-to-date list of disk space usage for all servers,
on my desk in 5 minutes"
Sounds familiar?
If you have a strict server naming convention, SERVERS.TXT itself can be generated with
the NET command:
FOR /F "delims=\ " %%A IN ('NET VIEW ^| FINDSTR /R /B
/C:"\\\\SRV\-"') DO (>>SERVERS.TXT ECHO.%%A)
Notes: (1) assuming server names start with "SRV-"; modify to match your own naming
convention.
Disable the firewall only when the computer (e.g. a laptop) is connected to the domain:
NETSH Firewall Set OpMode Mode = DISABLE Profile = DOMAIN
Disable the firewall comletely (not recommended unless an alternative enterprise firewall is
used that requires you to do so):
SC [ \\Remote_computer ] Stop SharedAccess
SC [ \\Remote_computer ] Config SharedAccess start=
disabled
or:
WMIC Path Win32_PingStatus WHERE "Address='127.0.0.1'" Get
StatusCode /Format:Value | FINDSTR /X "StatusCode=0" >NUL 2>&1
IF ERRORLEVEL 1 (ECHO IP v4 NOT supported) ELSE (IP v4
supported)
or:
WMIC Path Win32_PingStatus WHERE "Address='::1'" Get
StatusCode >NUL 2>&1
IF ERRORLEVEL 1 (ECHO IP v6 NOT supported) ELSE (IP v6
supported)
Windows 7 and 8:
DISM /Online /Get-Packages
or:
WMIC QFE List
Append
The append command can be used by programs to open files in another directory as if they were
The append command is available in MS-DOS as well as in all 32-bit versions of Windows. The append
Ads
Hard Disk Data Recoverywww.stellarinfo.co.in/DataRecoveryLost your data, Stellar would help Call For
Free Consultation
Shop Laptops OnlineDell.com/IN/Festive-DealsCheck for Dell Festive Offer on PCs W/ Intel Core.
Hurry Up!
Arp
The arp command is used to display or change entries in the ARP cache.
Assoc
The assoc command is used to display or change the file type associated with a particular file
extension.
The assoc command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
At
The at command is used to schedule commands and other programs to run at a specific date and
time.
Beginning in Windows 8, command line task scheduling should instead be completed with the schtasks
command.
Atmadm
The atmadm command is used to display information related to asynchronous transfer mode (ATM)
Support for ATM was removed beginning in Windows Vista, making the atmadm command
unnecessary.
Attrib
The attrib command is used to change the attributes of a single file or a directory.
Auditpol
Bcdboot
The bcdboot command is used to copy boot files to the system partition and to create a new system
BCD store.
Lab facilities
Infrastructure Manager
Bcdedit
The bcdedit command is used to view or make changes to Boot Configuration Data.
The bcdedit command replaced the bootcfg command beginning in Windows Vista.
Bdehdcfg
The bdehdcfg command is used to prepare a hard drive for BitLocker Drive Encryption.
Bitsadmin
The bitsadmin command is used to create, manage, and monitor download and upload jobs.
While the bitsadmin command is available in both Windows 8 and Windows 7, it is being phased out.
Ads
Data Recoverywww.StellarInfo.co.inCall Stellar Data Recovery To Get Back Lost Data. Free
Consultation
Bootcfg
The bootcfg command is used to build, modify, or view the contents of the boot.ini file, a hidden file
that is used to identify in what folder, on which partition, and on which hard drive Windows is located.
The bootcfg command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
The bootcfg command was replaced by the bcdedit command beginning in Windows Vista. Bootcfg is
still available in Windows 8, 7, and Vista, but it serves no real value since boot.ini is not used in these
operating systems.
Bootsect
The bootsect command is used to configure the master boot code to one compatible with BOOTMGR
The bootsect command is also available in Windows 7 and Windows Vista but only from the Command
Break
The break command sets or clears extended CTRL+C checking on DOS systems.
The break command is available in Windows XP and later versions of Windows to provide compatibility
Cacls
The cacls command is used to display or change access control lists of files.
The cacls command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
The cacls command is being phased out in favor of the icacls command, which should be used instead
Call
The call command is used to run a script or batch program from within another script or batch
program.
Cd
Certreq
The certreq command is used to perform various certification authority (CA) certificate functions.
Ads
Windowwww.hktdc.comFind quality building & decorative hardware. 28-30 Oct. Register now!
Lab facilities
Certutil
The certutil command is used to dump and display certification authority (CA) configuration
Change
The change command changes various terminal server settings like install modes, COM port
Chcp
The chcp command displays or configures the active code page number.
Hard Disk Data Recoverywww.stellarinfo.co.in/DataRecoveryLost your data, Stellar would help Call
Easy Migration.
Chdir
The chdir command is used to display the drive letter and folder that you are currently in. Chdir can
also be used to change the drive and/or directory that you want to work in.
Checknetisolation
The checknetisolation command is used to test apps that require network capabilities.
Chglogon
The chglogon command enables, disables, or drains terminal server session logins.
Chgport
The chgport command can be used to display or change COM port mappings for DOS compatibility.
Chgusr
The chgusr command is used to change the install mode for the terminal server.
Chkdsk
The chkdsk command, often referred to as check disk, is used to identify and correct certain hard
drive errors.
Chkntfs
The chkntfs command is used to configure or display the checking of the disk drive during the
The chkntfs command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Ads
Choice
The choice command is used within a script or batch program to provide a list of choices and return
The choice command is available in MS-DOS and all versions of Windows except Windows XP.
Use the set command with the /p switch in place of the choice command in batch files and scripts that
Cipher
The cipher command shows or changes the encryption status of files and folders on NTFS partitions.
The cipher command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Clip
The clip command is used to redirect the output from any command to the clipboard in Windows.
Ads
Hard Disk Data Recoverywww.stellarinfo.co.in/DataRecoveryLost your data, Stellar would help Call
FaxFacts by Copia
Cls
The cls command clears the screen of all previously entered commands and other text.
Cmd
The cmd command starts a new instance of the cmd.exe command interpreter.
The cmd command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Cmdkey
The cmdkey command is used to show, create, and remove stored user names and passwords.
Cmstp
The cmstp command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Color
The color command is used to change the colors of the text and background within the Command
Prompt window.
The color command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Command
The command command starts a new instance of the command.com command interpreter.
The command command is available in MS-DOS as well as in all 32-bit versions of Windows. The
Comp
The comp command is used to compare the contents of two files or sets of files.
The comp command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Ads
Immediately!
Shop Laptops OnlineDell.com/IN/Festive-DealsCheck for Dell Festive Offer on PCs W/ Intel Core.
Hurry Up!
Compact
The compact command is used to show or change the compression state of files and directories on
NTFS partitions.
The compact command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Convert
The convert command is used to convert FAT or FAT32 formatted volumes to the NTFS format.
The convert command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Copy
The copy command does simply that - it copies one or more files from one location to another.
The xcopy command is considered to be a more "powerful" version of the copy command.
Ads
free Wi-Fi modemshop.airtel.com/broadbandwith high speed airtel broadband connection. Buy now
online!
Easy Migration.
Cscript
The cscript command is used to execute scripts via Microsoft Script Host.
The cscript command is most popularly used to manage printers from the command line using scripts
Ctty
The ctty command is used to change the default input and output devices for the system.
The functions provided by the ctty command were no longer necessary beginning in Windows XP
because the command.com interpreter (MS-DOS) is no longer the default command line interpreter.
Date
Dblspace
DriveSpace, executed using the drvspace command, is an updated version of DoubleSpace. Windows
Debug
The debug command starts Debug, a command line application used to test and edit programs.
The debug command is available in MS-DOS as well as in all 32-bit versions of Windows. The debug
Defrag
The defrag command is used to defragment a drive you specify. The defrag command is the command
Del
Ads
Deltree
The deltree command is used to delete a directory and all the files and subdirectories within it.
Beginning in Windows XP, a folder and its files and subfolders can be removed using the /s function of
the rmdir command. Deltree was no longer needed with this new rmdir ability so the command was
removed.
Diantz
The diantz command is used to losslessly compress one or more files. The diantz command is
The diantz command is available in Windows 7, Windows Vista, and Windows XP.
The diantz command is the same as the makecab command.
Dir
The dir command is used to display a list of files and folders contained inside the folder that you are
currently working in. The dir command also displays other important information like the hard drive's
serial number, the total number of files listed, their combined size, the total amount of free space left
Ads
Hard Disk Data Recoverywww.stellarinfo.co.in/DataRecoveryLost your data, Stellar would help Call For
Free Consultation
free Wi-Fi modemshop.airtel.com/broadbandwith high speed airtel broadband connection. Buy now
online!
Diskcomp
The diskcomp command is used to compare the contents of two floppy disks.
Diskcopy
The diskcopy command is used to copy the entire contents of one floppy disk to another.
Diskpart
The diskpart command is used to create, manage, and delete hard drive partitions.
The diskpart command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
The diskpart command replaced the fdisk command beginning in Windows XP.
Diskperf
The diskperf command is used to manage disk performance counters remotely.
The diskperf command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Diskraid
The diskraid command starts the DiskRAID tool which is used to manage and configure RAID arrays.
Dism
The dism command starts the Deployment Image Servicing and Management tool (DISM). The DISM
Dispdiag
The dispdiag command is used to output a log of information about the display system.
Ads
Windowwww.hktdc.comFind quality building & decorative hardware. 28-30 Oct. Register now!
tips.
Djoin
Doskey
The doskey command is used to edit command lines, create macros, and recall previously entered
commands.
Dosshell
The dosshell command starts DOS Shell, a graphical file management tool for MS-DOS.
The dosshell command is available in Windows 95 (in MS-DOS mode) and also in MS-DOS version 6.0
and later MS-DOS versions that were upgraded from previous versions that contained the dosshell
command.
A graphical file manager, Windows Explorer, became an integrated part of the operating system
Ads
Hard Disk Data Recoverywww.stellarinfo.co.in/DataRecoveryLost your data, Stellar would help Call For
Free Consultation
Dosx
The dosx command is used to start DOS Protected Mode Interface (DPMI), a special mode designed to
give MS-DOS applications access to more than the normally allowed 640 KB.
The dosx command is available in Windows 8, Windows 7, Windows Vista, and Windows XP. The dosx
The dosx command and DPMI is only available in Windows to support older MS-DOS programs.
Driverquery
The driverquery command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Drvspace
DriveSpace is an updated version of DoubleSpace, executed using the dblspace command. Windows
natively handles compression beginning in Windows XP.
Echo
The echo command is used to show messages, most commonly from within script or batch files. The
echo command can also be used to turn the echoing feature on or off.
Edit
The edit command starts the MS-DOS Editor tool which is used to create and modify text files.
The edit command is available in MS-DOS as well as in all 32-bit versions of Windows. The edit
Edlin
The edlin command starts the Edlin tool which is used to create and modify text files from the
command line.
The edlin command is available in all 32-bit versions of Windows but is not available in 64-bit versions
of Windows.
In MS-DOS, the edlin command is only available up to MS-DOS 5.0 so unless your later version of MS-
DOS was upgraded from 5.0 or prior, you won't see the edlin command.
Emm386
The emm386 command is used to give MS-DOS access to more than 640 KB of memory.
Windows itself has access to extended and expanded memory beginning in Windows 95.
Ads
FaxFacts by Copia
Endlocal
The endlocal command is used to end the localization of environment changes inside a batch or script
file.
The endlocal command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Erase
Esentutl
The esentutl command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Ads
you now!
Fax Server Softwarewww.copia.com/faxfacts/Save money on telcom costs with your own FaxFacts Fax
Server
Eventcreate
The eventcreate command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Eventtriggers
Beginning in Windows Vista, event triggers are created using the Attach Task To This Event feature in
The exe2bin command is used to convert a file of the EXE file type (executable file) to a binary file.
The exe2bin command is available in 32-bit versions of Windows 8, Windows 7, Windows Vista, and
Windows XP. The exe2bin command is not available in any 64-bit version of Windows.
Exit
The exit command is used to end the cmd.exe (Windows) or command.com (MS-DOS) session that
Expand
The expand command is used to extract a single file or a group of files from a compressed file.
The expand command is available in MS-DOS as well as in all versions of Windows. The expand
Extrac32
The extrac32 command is used to extract the files and folders contained in Microsoft Cabinet (CAB)
files.
The extrac32 command is actually a CAB extraction program for use by Internet Explorer but can be
used to extract any Microsoft Cabinet file. Use the expand command instead of the extrac32 command
if possible.
Extract
The extract command is used to extract the files and folders contained in Microsoft Cabinet (CAB)
files.
The extract command was replaced by the expand command beginning in Windows XP.
Ads
free Wi-Fi modemshop.airtel.com/broadbandwith high speed airtel broadband connection. Buy now
online!
Hard Drive Data Recoverywww.StellarInfo.co.inCall Stellar Data Recovery To Get Back Lost Data. Free
Consultation
Fasthelp
The fasthelp command provides more detailed information on any of the other MS-DOS commands.
The help command replaced the fasthelp command beginning in Windows 95.
Fastopen
The fastopen command is used to add a program's hard drive location to a special list stored in
memory, potentially improving the program's launch time by removing the need for MS-DOS to locate
The fastopen command is available in MS-DOS as well as in all 32-bit versions of Windows. The
Fastopen is only available in Windows 8, 7, Vista, and XP to support older MS-DOS files.
Fc
The fc command is used to compare two individual or sets of files and then show the differences
between them.
Ads
Data Recoverywww.StellarInfo.co.inCall Stellar Data Recovery To Get Back Lost Data. Free
Consultation
Photographer.Enroll Now!
Download Free Softwaremobogenie.com/download-softwareDownload Free PC Manager Software.
Fdisk
The fdisk command is used to create, manage, and delete hard drive partitions.
The fdisk command was replaced by the diskpart command beginning in Windows XP. Partition
management is also available from Disk Management in Windows 8, 7, Vista, and XP.
Find
The find command is used to search for a specified text string in one or more files.
Findstr
The findstr command is used to find text string patterns in one or more files.
The findstr command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Finger
The finger command is used to return information about one or more users on a remote computer
The finger command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Fltmc
The fltmc command is used to load, unload, list, and otherwise manage Filter drivers.
The fltmc command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Fondue
The fondue command, short for Features on Demand User Experience Tool, is used to install any of
Panel.
For
The for command is used to run a specified command for each file in a set of files. The for command is
Ads
Safe Hair Fall Treatmentwww.drBatras.com/Hair+FallVisible Results In Over 92% Patients. Visit Now!
Forcedos
The forcedos command is used to start the specified program in the MS-DOS subsystem.
The forcedos command is only used for MS-DOS programs that are not recognized as such by
Windows XP.
Forfiles
The forfiles command selects one or more files to execute a specified command on. The forfiles
Format
The format command is used to format a drive in the file system that you specify.
Drive formatting is also available from Disk Management in Windows 8, 7, Vista, and XP.
Ads
Data Recovery Softwarewww.StellarInfo.co.inCall Stellar Data Recovery To Get Back Lost Data. Free
Consultation
Score 750 = Card approvedwww.cibil.com/creditcardCheck your credit score before you apply. Check
Lab facilities
Fsutil
The fsutil command is used to perform various FAT and NTFS file system tasks like managing reparse
The fsutil command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Ftp
The ftp command can used to transfer files to and from another computer. The remote computer must
Ftype
The ftype command is used to define a default program to open a specified file type.
The ftype command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
Getmac
The getmac command is used to display the media access control (MAC) address of all the network
controllers on a system.
The getmac command is available in Windows 8, Windows 7, Windows Vista, and Windows XP.
The shutdown command is a Command Prompt command that can be used to shut down, restart, log
The shutdown command can also be used to remotely shut down or restart a computer you have
access to over a network.
Shutdown Command Syntax:
Tip: See How To Read Command Syntax if you're not sure how to read the shutdown command
/i = This shutdown option shows the Remote Shutdown Dialog, a graphical version of the remote shut
down and restart features available in the shutdown command. The /i switch must be the first switch
/l = This option will immediately log off the current user on the current machine. You can not use the
/l option with the /m option to log off a remote computer. The /d, /t, and /c options are also not
/s = Use this option with the shutdown command to shut down the local or /m defined remote
computer.
/r = This option will shut down and then restart the local computer or the remote computer specified
in /m.
/g = This shutdown option functions the same as the /r option but will also restart any registered
/a = Use this option to stop a pending shut down or restart. Remember to use the /m option if you're
planning on stopping a pending shut down or restart that you executed for a remote computer.
/p = This shutdown command option turns off the local computer completely. Using the /p option is
similar to executing shutdown /s /f /t 0. You can not use this option with /t.
/h = Executing the shutdown command with this option immediately puts the computer you're on into
hibernation. You can not use the /h option with the /m option to put a remote computer into
hibernation, nor can you use this option with /t, /d, or /c.
/e = This option enables documentation for an unexpected shut down in the Shutdown Event Tracker.
/o = Use this shutdown switch to end the current Windows session and open the Advanced Boot
Options menu. This option must be used with /r. The /o switch is new beginning in Windows 8.
/hybrid = This option performs a shutdown and prepares the computer for fast startup. The /hybrid
options, not using shutdown's /f option will present a warning about the pending shut down or
restart.
/m \\computername = This shutdown command option specifies the remote computer that you want
/t xxx = This is the time, in seconds, between the execution of the shutdown command and the
actual shut down or restart. The time can be anywhere from 0 (immediately) to 315360000 (10
years). If you don't use the /t option then 30 seconds is assumed. The /t option is not available with
/d [p:|u:]xx:yy = This records a reason for the restart or shut down. The p option indicates a planned
restart or shut down and the u a user defined one. The xx and yy options specify major and minor
reasons for the shut down or restart, respectively, a list of which you can view by executing the
shutdown command without options. If neither p nor u are defined, the shut down or restart will be
recorded as unplanned.
/c "comment" = This shutdown command option allows you to leave a comment describing the
reason for the shut down or restart. You must include quotes around the comment. The maximum
/? = Use the help switch with the shutdown command to show detailed help about the command's
several options. Executing shutdown without any options also displays the help for the command.
Tip: Each time Windows is shut down or restarted manually, including via the shutdown command,
the reason, type of shut down, and [when specified] comment are recorded in the System log in Event
Tip: You can save the output of the shutdown command to a file using a redirection operator. See
How To Redirect Command Output to a File for help doing that or see Command Prompt Tricks for
more tips.
In the above example, the shutdown command is used to restart the computer that's currently being
used and records a reason of Other (Planned). The restart is designed by /r and the reason is
specified with the /d option with p representing that the restart is planned and the 0:0 indicating an
"Other" reason.
Remember, major and minor reason codes on a computer can be displayed by executing shutdown
without options and referencing the Reasons on this computer table that's displayed.
shutdown /l
Using the shutdown command as shown here, the current computer is immediately logged off. No
In this shutdown command example, a remote computer named SERVER is being shut down with a
recorded reason of Other (Planned). A comment is also recorded as Planned restart by Tim. Since no
time is designated with the /t option, the shutdown will begin on SERVER 30 seconds after executing
Finally, in this last example, the shutdown command is used to shut down the local computer
For example: