280
votes

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

6
  • 11
    If you find this stuff interesting, take a look at commandlinefu: commandlinefu.com It's basically like digg for CLI
    – username
    May 11, 2009 at 6:47
  • great list, very usefull
    – Adyt
    May 20, 2009 at 8:56
  • 1
    Try putting each command as a separate answer. Then we can vote and comment on each one.
    – lamcro
    Jun 26, 2009 at 12:22
  • 1
    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... Jul 29, 2009 at 22:00
  • 1
    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, 2010 at 14:16

160 Answers 160

1
vote

To quickly open the Exchange 2007 Management Shell:

exshell.psc1

Active Directory Sites and Services:

dssite.msc

Basically, anything in the start menu I try to grab the properties of the shortcuts and find out what they actually call.

Oh, and the "elevated" command-prompt in Vista:

Start -> from the Search box "cmd" + Ctrl+Shift+Enter

:)

1
vote
perfmon

Opens up Windows Performance Monitor.

1
vote

The key combination . . . notepad will show all files in the directory, use the up and down key to select, then enter to execute the command. Very useful for lazy typers like myself.

1
vote
getmac

shows the MAC address of any network adapters installed.

1
1
vote

dsa.msc - opens active directory users and computers.

1
vote
whoami /all

Used to be reskit.

1
vote

qfecheck
for Server 2003,2000 & XP - Does not apply to Server 2008, Vista or Win7(as far as I know)

Shows installed Hotfixes applied to the server/workstation.

More detail at -> http://support.microsoft.com/kb/282784

1
vote

vssadmin

Usage:

vssadmin list shadows [/set={shadow copy set guid}]
        Lists all shadow copies in the system, grouped by shadow copy set Id.

vssadmin list writers
        Lists all writers in the system

vssadmin list providers
        Lists all currently installed shadow copy providers

vssadmin is essential to troubleshooting backup products that use vss. With vssadmin you can check writer status, and list all outstanding shadow copies on a volume. Very handy.

1
vote

I particularly like pushd and popd for directory navigation via stack. Not only can they change the current folder, they can also change the current drive. (cd /d can do this too.) What's more, if you try to pushd to a UNC path, the shell will automatically map the share to a drive letter starting from Z and working backwards. When the matching popd is called, the drive is unmapped automatically.

1
vote

A particularly useful aspect of netsh that I think is worth a mention: netsh winsock reset This was added in XP service pack 2 to reset the tcpip implementation back to its defaults. In versions prior to XP, this was accomplished by uninstalling and reinstalling TCP/IP. Prior to SP2 you either needed the winsockxpfix.exe application or an ugly method of ripping out tcp/ip and reinstalling it. This command can correct issues where tcp/ip becomes corrupted for whatever reason.

Also, the HELP command lists a whole slew of other commands that can be of use.

1
vote

Change {username}'s password:

net user {username} {newpass}

map a network drive

net use z: \\servername\sharename /user:username
1
vote
  1. mspaint

alt text

  1. msconfig :-System Configuration Utility alt text

3. ping ip address alt text

4.textpad

alt text

5.sshclient alt text

6.%temp% alt text

1
vote

Command to abort the shutdown process.

c:\shutdown -a

1
vote

Sound

The command

mmsys.cpl

opens

alt text

1
vote

Date and Time

The command

timedate.cpl

opens

alt text

1
vote

Windows Security Center

wscui.cpl

opens

alt text

1
vote

tracert

Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Options:

-d                 Do not resolve addresses to hostnames.

-h maximum_hops    Maximum number of hops to search for target.

-j host-list       Loose source route along host-list.

-w timeout         Wait timeout milliseconds for each reply.
1
vote

The items in the following list might be duplicates, but I just want to add it just in case (this is from a buddy's list). This might be more useful to an office worker than to a system administrator though:

  1. devmgmt.msc = Device Manager
  2. msinfo32 = System Information
  3. cleanmgr = Disk Cleanup
  4. ntbackup = Backup or Restore Wizard (Windows Backup Utility)
  5. mmc = Microsoft Management Console
  6. excel = Microsoft Excel (If Installed)
  7. msaccess = Microsoft Access (If Installed)
  8. powerpnt = Microsoft PowerPoint (If Installed)
  9. winword = Microsoft Word (If Installed)
  10. frontpg = Microsoft FrontPage (If Installed)
  11. notepad = Notepad
  12. wordpad = WordPad
  13. calc = Calculator
  14. msmsgs = Windows Messenger
  15. mspaint = Microsoft Paint
  16. wmplayer = Windows Media Player
  17. rstrui = System Restore
  18. netscp6 = Netscape 6.x
  19. netscp = Netscape 7.x
  20. netscape = Netscape 4.x
  21. waol = America Online
  22. control = Opens the Control Panel
  23. control printers = Opens the Printers Dialog
1
vote

pathping - a traceroute that collects detailed packet loss statistics.

1
vote

Behold:

command.com

Very often would I see the system being plagued by trojans/worms that attempt to lock down every way of getting through to system internals like regedit, mmc, cmd.exe, etc. Then you have no choice, but to boot from a live CD. But, obviously, with command.com at your disposal you can do anything you want, and I've yet to see THAT made unavailable.

1
vote

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.

nbtstat

NTRIGHTS.EXE grant sePriveleges

Set /P for prompting.

IF ELSE in batch:

IF EXIST filename. (
    del filename.
) ELSE (
    echo filename. missing.
)
1
  • Thanks for ipocnfig /displaydns, I did not know about that one. It seems like it could be useful.
    – railmeat
    Aug 11, 2009 at 2:24
1
vote

Use

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.)

1
vote

psexec

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
1
vote
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.)

1
vote

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.

1
  • PRINT? Not ECHO?
    – jscott
    Dec 11, 2011 at 15:24
1
vote
Disk Management
diskmgmt.msc

Opens
enter image description here

1
vote
Keyboard Properties
control keyboard

Opens
enter image description here

1
vote
Regional and Language Options
intl.cpl

Opens
enter image description here

1
vote
Internet Properties
inetcpl.cpl

Opens
enter image description here

0
votes

It is always fun to create a macro that performs a quick and unconditional format of a disk:

doskey cd=format $1 /q /u

Then to format a disk in drive A type:

cd A:
1
  • 1
    Shame they dropped the format's /autotest parameter. ;)
    – macbirdie
    May 6, 2009 at 6:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .