News & Blog

Command Prompt (CMD) Tips Every Windows User Should Know

Command Prompt is one of the most powerful tools in any version of Windows as any regular user will tell you. However,

Command Prompt is one of the most powerful tools in any version of Windows as any regular user will tell you. However, one drawback is that it is not exactly user-friendly and is simply not as intuitive as the Windows GUI.

However, with a bit of knowledge and a few tips, Command Prompt is a whole lot easier to use. Below, we have outlined some of our favorite tips, tricks and shortcuts in Command Prompt to save you some time or just make the experience a little less frustrating.

Automatically Run CMD as Administrator

A number of commands in Command Prompt require that you execute them as an Administrator. Command Prompt can be opened as an Administrator at any time by right clicking on the icon and selecting the “Run as administrator” option.

However, if you frequently need to run Command Prompt as an Administrator, it can be useful to have an automatic shortcut to Elevated Command Prompt. To do this, simply create a Command Prompt shortcut, right click and select properties. On the Compatibility window, check the “Run this program as an administrator’ box and save the changes.

Command Prompt Help

While there is a help command in Command Prompt, it doesn’t provide information on all of the different commands available in CMD. However, there is also a help switch which allows you to easily display detailed information on any specific command.

The help switch is activated by simply adding /? to the end of any command. For example entering dir/? into Command Prompt will give you detailed information on the function of this command and some examples of how you may use it.

Quick Edit Mode

As standard, you cannot copy and paste text in Command Prompt in the same manner you would in other programs. Instead, you have to right-click, select Mark the menu and then highlight the relevant text. Similarly, you need to right-click in order to paste text into CMD.

Switching to QuickEdit Mode in Command Prompt is a simple time-saver which allows you to quickly copy text by highlighting then right-clicking. To activate QuickEdit Mode, simply open the Properties menu and under the Edit Options, activate QuickEdit Mode.

Drag and Drop

This is one of the simplest and most intuitive tips in Command Prompt, yet many users don’t immediately realize it is possible. You can drag and drop files just about everywhere else in Windows, so why no Command Prompt also?

Dragging any file and dropping it into an open Command Prompt window will automatically complete the file path saving you from typing the full thing out. This tip can also be combined with a command. For example, enter the del command then drag and drop to delete.

Tab Completion

Tab completion is another shortcut in Command Prompt which can save you some time when entering file paths. Tab completion is simple to use, simply type the part of the path that you know, press tab and the rest of the path will be auto-completed.

Tab completion can also be used to cycle through the available files in a directory. For example, typing C:\Users\Name\Desktop\ and repeadetly pressing tab will cycle through the availalbe files while tab and shift will cycle in the opposite direction.

Previously Used Commands

Command Prompt keeps a record of all the different commands you have entered during your current session which can easily be accessed by using the arrow keys at any time which is a useful time saver if you make an error in a long command.

You can quickly cycle through the list of previously used commands by using the Up and Down arrow keys. The Right arrow key can also be used to input the last command you used character by character.

Text File

Sometimes it is necessary to get the output from Command Prompt into a file for some other use. Unfortunately, copying and pasting form CMD isn’t exactly user-friendly and in cases where there is a large amount of output, this isn’t exactly the best option.

Fortunately, the redirect command provides an easy way to create a text file with your commands output. For example, to create a file containing your system info, simply typing systeminfo > C:\systeminfo.txt will create a new text file with the systeminfo command output.

Check IP Address

There are numerous ways to find your IP address, but using the Command Prompt is probably one of the easiest and quickest methods. This is achieved by simply opening Command Prompt and using the ipconfig command.

Modifying this command with the /all switch i.e. ipconfig/all, will provide detailed configuration information on all interfaces including Local Area Networks (LAN) and Wide Area Networks (WAN).

Command Prompt Function Keys

And finally, The function keys (F1 to F9) can be used in Command Prompt for a number of useful shortcuts:

F1: Prints the characters of the previous used command character by character
F2: Prints the characters of the previous command up to specified character
F3: Repeats the previous command
F4: Deletes current text up to specified character
F5: Pastes the previously used commands
F6: Places CTRL+Z at the current insertion point
F7: Displays a list of previously executed commands
F8: Cycles through the previously used commands
F9: Pastes one of the commands from the list displayed in F7

For more tips to save you some time around the office and make your day more productive, check out our blog post on The Best Outlook Plugins & Add-Ins for Business and for some more great tools, read our 10 Useful Tools for IT Professionals post.