Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The aim for this Wiki is to promote using a command to open up commonly used applications without having to go through many mouse clicks - thus saving time on monitoring and troubleshooting Windows machines.

Answer entries need to specify

  • Application name
  • Commands
  • Screenshot (Optional)

Shortcut to commands


locked by Zypher Dec 11 '11 at 21:18

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

If you find this stuff interesting, take a look at commandlinefu: It's basically like digg for CLI – username May 11 '09 at 6:47
Try putting each command as a separate answer. Then we can vote and comment on each one. – lamcro Jun 26 '09 at 12:22
This is a great question, super useful info, and the stackexchange engine made it trivial to find. I agree with @lamcro, however, that structuring each command as an individual answer would likely provide more value, however then the wouldn't be sorted alphabetically? hmmm... – David Alpert Jul 29 '09 at 22:00
This is a great example, across all SE, of a well-executed poll. I especially like combining separate answers (for voting) and alphabetical index to them! – Jonik Sep 17 '10 at 14:16

160 Answers 160

To open the Windows Event Log (Event Viewer).


enter image description here


To free up some disk space:

format c:

No, really, here's Disk Cleanup:


enter image description here


control userpasswords2

Opens the classic User Accounts dialog:

enter image description here

Internet Information Services (IIS) Manager
InetMgr.exe - IIS 7
InetMgr6.exe - IIS 6
  • IIS 7
    enter image description here

  • IIS 6
    enter image description here

Internet Properties

enter image description here


enter image description here#####Mouse Properties control mouse

-- or --



Regional and Language Options

enter image description here

Network and Sharing Center
control.exe /name Microsoft.NetworkAndSharingCenter


enter image description here

Keyboard Properties
control keyboard

enter image description here

ODBC Data Source Administrator

enter image description here

Disk Management

enter image description here

Device Manager


enter image description here

If you set the environment variable devmgr_show_nonpresent_devices to 1 before launching device manager, then when you show hidden devices it will show all the completely inactive devices (e.g. have been removed) as well. – Richard May 4 '09 at 9:35
Computer Management

enter image description here


Opens enter image description here

You can just use "eventvwr" and save a few characters. – boflynn May 4 '09 at 10:57

The clip command on Windows Vista and Windows Server 2008 is very useful: it puts anything passed in on standard input on the clipboard.


Copy current directory to clipboard:

dir | clip

List C files containing a particular string:

findstr /i /s /m /c:"someFunction" *.c | clip

print %logonserver%

A very quick and easy way to view the DC that your workstation has authenticated against. Useful when working with GPO's and scripts.


The arp command gives you the IP address and Ethernet address for hosts your machine knows of on the network. Very useful to debug hairy network troubles... I usually use

arp -a

I seem to regularly use "sc stop wuauserv", which turns off the Windows Update service. Primarly to make it stop nagging me to restart every few minutes.


Windows Update Service


/a /ResetAuthorization
/r /ReportNow

This single command has a lot of mythology surrounding it. It reports no errors, has no help dialog, and the only real output is run for /demoui. But it does work, I think.



chkdsk (or checkdisk) is a command that checks the disk surface for physical errors or bad sectors. It can also fix logical file system errors.


bootsect.exe {/help | /nt52 | /nt60} {SYS | ALL | <DriveLetter:>} [/force]

From Bootsect Command-Line Options:

Bootsect.exe updates the master boot code for hard disk partitions to switch between BOOTMGR and NTLDR. You can use this tool to restore the boot sector on your computer.

Mind you that this tool is only available on the Windows installation DVD under the BOOT folder. (I think only Windows Vista or higher.)


Disk management from the command line:


See A Description of the Diskpart Command-Line Utility for more information.


Useful for batch/cmd processing:

cd %0\..

changes the path including the drive to the directory where the batch/cmd files is located.

For example, when you have your bat/cmd in z:\test, and you open up a shortcut to the bat/cmd from your desktop, with the command inside your bat/cmd you can change the path to z:\test and go on from there.

Edit: the command above only changes the path, not the drive! My fault... I tested it only on the same drive. The correct command for also changing the drive would be

cd /d %0\..

cacls (or the more up-to-date icalcs):

cacls (Change Access Control Lists) is a command line utility for Microsoft Windows to change Access Control List (ACL) permissions on a directory, its subcontents, or files. An access control list is a list of permissions for a securable object, such as a file or directory, that controls who can access it.

alt text

It is a real life-saver on a file-server when specific file(s) and/or directory(s) permissions have to be modified.


Run dxdiag, a DirectX diagnostic tool. Apart from giving DirectX components installed on your system it also gives a system information summary. All information can be exported as a text file.

CIPHER: this is a good one to permanently delete files off the computer. Once a file is deleted, it is only marked as deleted and it won't truly be delted off the hard drive until it's overwritten with the information or you can run cipher and the location of where the file used to be to truly delete it from the hard drive.


cipher /w:"drive letter":"folder name"  


 cipher /w:C: (to do all the C: drive.) 


While it's from Sysinternals, the sysinternals tools are so essential and commonly installed on servers they might as well be part of the OS.

psexec \\targetserver -w "d:\bin" "cmd" 

You now have an interactive shell on a remote computer. Enter "exit" to come back home. I will often use it to apply something to a group of servers as follows.

set srvs=server1 server2 server3 
set execthis=[something useful]
for %s IN (%srvs%) DO (
start psexec \%s -u domain\someUser -p superSecretOfCourse "cmd" "/C %execthis%" 

Here I show several handy tricks:

  1. Use for loops to execute a command multiple times (from batch use %%s instead of %s)
  2. Start to open a window in a new process - handy if each operations takes a few minutes.
  3. Psexec can use windows auth or a login. Noting that integrated auth usually won't hop from local to server to a third location (e.g. SAN) - provide user and password if you need to access a network resource

If you have pstools installed in the root of drive C;

c:\pstools\psexec \\\\computername -u username -p password cmd

opens the command prompt on a remote machine. From there you can do whatever you want.


DIRCMD is an environmental variable that the DIR command reads its switches from.

Order directory listing by sub-directories, file extension, and name, including hidden and system files:

set DIRCMD=/ogen/a



httpcfg [query | set | delete] iplisten [ip address]

to find out or change the IP addresses IIS is listening on

(If you want to run IIS and some other HTTP server on the same box and port with different IP addresses.)


Get the current day, month and year into environment variables (adjust for locale).

Command line:

for /f "tokens=2,3,4 delims=/ " %a in ('echo %date%') do set mon=%a && set day=%b && set year=%c

Or in a batch file:

for /f "tokens=2,3,4 delims=/ " %%a in ('echo %date%') do set mon=%%a && set day=%%b && set year=%%c

Other stuff

ipconfig /displaydns

WMIC - command line access to WMI

dsqery, dsget, dsmod, dsadd - command line access to AD

net localgroup

for /f %%a (' some command ') do call :sub %%a

Use :: instead of REM in batch files.


NTRIGHTS.EXE grant sePriveleges

Set /P for prompting.

IF ELSE in batch:

IF EXIST filename. (
    del filename.
) ELSE (
    echo filename. missing.

protected by Iain Dec 11 '11 at 14:08

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.