up vote 283 down vote favorite
459
share [g+] share [fb]

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

link
11  
If you find this stuff interesting, take a look at commandlinefu: commandlinefu.com It's basically like digg for CLI – username May 11 '09 at 6:47
1  
Try putting each command as a separate answer. Then we can vote and comment on each one. – lamcro Jun 26 '09 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... – David Alpert Jul 29 '09 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 '10 at 14:16
show 2 more comments
feedback

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. More info: FAQ.

protected by Iain Dec 11 '11 at 14:08

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

160 Answers

fsmgmt.msc to access File Shares.

link
show 1 more comment
feedback

To manage the entire IIS7 from the standard command-line (no PowerShell needed ;)

appcmd.exe
link
show 2 more comments
feedback

There have been a couple of mentions of WMIC, but there's a lot of power there that isn't being highlighted. Granted, much of this can be done easier now with PowerShell, but if you don't know PowerShell or aren't able to use it for whatever reason, then it's WMIC to the rescue!

You are able to use many of the WQL keywords. For some reason a nice well-documented syntax on how to use these on the command line in conjunction with WMIC is not found anywhere.

Some examples:


List the QFE (Quick Fix Engineering) hotfixes installed on a system

// See them all
wmic qfe | more

// List the HotFixID, InstalledBy and InstalledOn properties of the ones that begin with "KB9"
wmic qfe where "HotfixID like '%KB9%'" get HotFixID,InstalledBy,InstalledOn

// Useful if you're just trying to find out if a particular KB is installed, and you don't care about the properties
wmic qfe | find "981793"

// Or, if you need the properties just for the one
wmic qfe where "HotFixID = 'KB981793'"

Display, start and stop services! Very useful when you have a group of related services that you need to stop/start.

// Display McAfee services
wmic service where "DisplayName like '%McAfee%'"

// Stop all McAfee services
wmic service where "DisplayName like '%McAfee%'" call StopService

Context-sensitive Help


See what properties are available with a particular alias:

wmic service get /?

See what methods are available with a particular alias:

wmic service call /?

See which classes the aliases map to:

wmic alias list brief

Run a query or command against multiple computers:


// Get a list of all the patches on hostname1 and hostname2 and save it as a .csv file for easy import into Excel
wmic /node:hostname1,hostname2 get /format:csv > Patches.csv

// You can also list all your systems (one per line) in a text file and run it against all of them:
wmic /node:@MyServers.txt get /format:csv > Patches.csv

link
feedback

"| more" is an essential sub-command. It pauses at each screen, making large amounts of text easier to read.

Examples:

dir | more
help | more
type filename.txt | more

It saves from scrolling back up to find what you want, and losing your place.

link
show 2 more comments
feedback

sqlwb Starts Microsof SQL Server Management Studio. Handy when you can't find it listed in the start menu, but you know it's installed on that server. :)

link
feedback

Amazing Shutdown timer:

shutdown -s -t 7200 -c "shutting down in 120 mins, please type 'shutdown -a' in a command prompt to cancel" -f
link
feedback

System Properties

The command

sysdm.cpl

opens

alt text

link
show 1 more comment
feedback

cls clears the command line screen.

It is very useful when you want to run a new command and clear the current screen.

link
feedback

If you're on one of the more professional Windows distributions (XP Professional, Vista Business, Vista Ultimate), use

gpedit.msc

to do Group Policy editing.

link
feedback

The command

powercfg.cpl

launches the power management control panel applet.

link
show 1 more comment
feedback

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

dir
link
feedback

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.

link
show 3 more comments
feedback

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.

Usage:

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

Example:

 cipher /w:C: (to do all the C: drive.) 
link
feedback
Keyboard Properties
control keyboard

Opens
alt text

link
feedback
Regional and Language Options
intl.cpl

Opens
alt text

link
feedback
Internet Properties
inetcpl.cpl

Opens
alt text

link
feedback

Task Manager | taskmgr.exe

link
8  
Ctrl-Shift-Esc uses fewer keys to open Task Manager. – Ryan Bolger May 4 '09 at 5:29
feedback
desk.cpl

opens the display properties. (Sorry, no image)

link
show 1 more comment
feedback

Best way to avoid clicks is to stay on the command line. A directory in your path with the GNU tools and the sysinternals tools will go a long way to making your life simpler. Nothing that a good grep can't fix. :-)

link
show 1 more comment
feedback

My favorites:

ipconfig
tracert
ping
telnet
link
feedback

Notepad or something similar

notepad
link
feedback
dsa.msc

is a nice quick way to open up Active Directory Users and Computers.

link
feedback
firewall.cpl

Opens the Windows Firewall settings.

link
feedback

System Configuration

msconfig

It is very useful to see what runs at startup

link
feedback

To allow user to log on without pressing ctrl-alt-delete, or log on without entering a password:

control userpasswords2
link
show 1 more comment
feedback

Years ago I started using sync.exe (for file cache flushing) from the NTinternals guys. I've been migrating that binary around for maybe a decade, and it still works. Their company got assimilated by Microsoft, but the binaries are still hanging around on the net if you search.

link
feedback

I've found Launchy to be a very useful tool for Windows. It lets you launch many programs that would normally be launched by clicking icons by typing a few keystrokes. There's also a version for Linux. It can be found at www.launchy.net, and is free and open-source.

For example, to open an Explorer window from anywhere, type Alt-space (the default Launchy hot-key) followed by "c:\" followed by Enter. You can run any program for which you have a Windows shortcut by typing a few characters from the name of the shortcut. For example: Alt-space "co" Enter brings up Control Panel. You can also do Google searches, open URLs in the browser, and many other things without taking your fingers from the keyboard.

link
feedback

FTP

alt text

link
feedback

Here is a VBScript that will do elevation when you RUNAS in Vista:

Set objShell = CreateObject("Shell.Application")
app = wscript.arguments(0)
args = ""
for i = 1 to (WScript.Arguments.length - 1)
   args = args + wscript.arguments(i)
next
objShell.ShellExecute app, args, "", "runas"

Use like so: runas.exe /user:domain\user "wscript.exe runas_script.vbs mmc.exe"

link
feedback

The following web site shows how to create command line shortcuts to anything using the Windows registry key, "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths".

Customizing Windows Run Command
http://weblogs.asp.net/whaggard/archive/2004/04/11/111232.aspx

link
feedback

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