Useful Keyboard Shortcuts for the DOS Command Prompt

command-prompt-shortcut-keys We look at some useful keyboard shortcuts and commands that will help you personalize the MS-DOS Command Prompt Window without using the mouse.

You will also learn about hotkeys for executing DOS commands more quickly. The keyboard shortcuts are known to work in Windows Vista and XP command prompt.

1. Change the color scheme of the DOS Window

dos color shortcutcolor bf - where b is the background color while f is for the foreground color (they are hex codes).

For instance, if you want to have a white background with black text, type color F0 and press enter. To revert to the original color scheme, type color without any arguments.

For a list of all available colors, type color /? on the command line.

2. Chant the Title of the Window to reflect the current time


Do you know that you can put your name or your blog address in the title of the command prompt window. That’s like a neat watermark when you are using that screenshot for your website.

title your_name  %time%

That %time% will append the current timestamp to the Window’s title.

3. Navigate the Command History using Keyboard

If you have a long list of commands in the history, press the function key F7 to navigate through the history list using the arrow keys.

And if you already know the command number, press F9 and directly type that number. Very useful if you have to run some command repeatedly.


4. Typing Long Commands at the DOS Prompt

You know the frustration when you type some long command only to realize that you made a typo or omitted typing some character. Either type the whole command again or a better option is the F1 key.

f2-dos-command F1 prints characters of the previous command one by one.

Alternatively, you can press F2 to copy a certain number of characters from the previous command to the current one. Let me illustrate that with an example:

Say I want to run the command “nslookup” but wrote “nslookup” in a hurry.

Instead of retyping the whole thing, I can say F2 and then say x. This will print all the characters upto “x”. Then you can press F3 to complete the command or type it manually.

Related: Copy Command Line Output to Clipboard

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory


Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.