Useful Keyboard Shortcuts for the DOS Command Prompt

Published in: command line - DOS

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

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: command line - DOS

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

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. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube