Home > Batch Scripting, Scripting, Windows > Stupid Command Prompt Tricks

Stupid Command Prompt Tricks

Windows XP isn’t known for its powerful command line interface. Still, one of the first things I do on any fresh Windows install is set up the “Open Command Window Here” right click menu. And hoary old cmd.exe does have a few tricks up its sleeve that you may not know about.

 

Ye Olde Command Prompt

The first thing you’ll want to do is Start, Run, cmd.exe, then right click the window menu and choose properties. Be sure to enable the following quality of life improvements:

  • Options | Command History | Buffer Size | 500
  • Options | Command History | Discard Old Duplicates | True
  • Options | Edit Options | QuickEdit Mode | True
  • Layout | Screen buffer size | Height | 999
  • Layout | Window size | Height | 50

Now we’ve got some room to actually see stuff! QuickEdit mode enables copying from the command prompt by intuitively dragging and right clicking with the mouse. Furthermore, you can paste what’s in the clipboard to the command line by right clicking with nothing selected.

And of course, set the font and colors to taste. I use green-screen style colors (background 0 55 0, foreground 0 255 0) with Lucida Console as pictured above. But if you prefer Comic Sans here, be my guest! When exiting this dialog, you’ll be prompted to save. Make sure you select “Save properties for future windows with same title” so all future command prompts will benefit from these improved settings.

  • There are also a few helpful keyboard shortcuts that aren’t always widely known:
  • Pressing arrow up selects a previous command from your command history; similarly, arrow down selects the next command.
  • Pressing F7 pops up your command history list.
  • You can drag n’ drop files or folders from an explorer window into a command prompt; this inserts the quoted path as if you had manually pasted it.
  • Tab completion is fully supported; type edit *.ini then hit TAB to iterate through all matches. Use SHIFT+TAB to move to the previous match. This works for partial filenames as you would expect, and in all commands.
  • Tired of the typical “c:\windows\system32\cmd.exe” window title? Change it using the TITLE command.
  • ALT+ENTER takes your command prompt to fullscreen mode and back again.

Happy batching 😀

  1. Steven Brightside
    March 9, 2008 at 6:30 pm

    Is it possible to perform a focre logout without confermation using command prompt?
    And is it possible to use a batch file that opens a batch file that opens the first one to create and endless annoying loop?

  2. Andrew Morgan
    May 22, 2008 at 5:57 pm

    to force a logout without confirmation use “shutdown -m \\computername -l -t 03 -c “put a comment here”

    as for the looping batch file, if its pissing off people that you want, try this:

    :start
    start cmd
    goto start

    that’ll crash the pc by opening cmd’s infinately.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: