Loading

Sunday, November 8, 2009

Windows Command Prompt: Auto-Complete Paths and Filenames

SUMMARY: Let Windows automatically complete your keyed-in paths and filenames.

If you regularly use the Windows Command (or DOS) Prompt (CMD.EXE), you may find it cumbersome to type in long directories or filenames. With this trick, you can use the TAB key to have Windows automatically complete your path or filename.

For example, if you are at C:\ and type:
C:\>cd doc
Then press the TAB key, Windows will automatically complete the command with:
C:\>cd "Documents and Settings"
First you have to make a couple modifications to the Windows Registry (do so at your own risk).
  1. Open Regedit by clicking Start / Run, then type Regedit and press OK (or ENTER). Make sure you are an administrator (especially in Windows 7, Vista and 2008).
  2. Navigate the Registry to My Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor.
  3. In the right pane, double-click "CompletionChar" and key in "9", then press OK.
  4. Do the same for "PathCompletionChar".
  5. Close Regedit, then open a new command prompt.
See also:

2 comments:

  1. Thanks, your post helped me a lot.

    ReplyDelete
  2. Thanks!
    Do you know why it is turned off by default on w7?

    ReplyDelete