How To Enable Command Prompt Automatic Completion in Windows XP

winlogo.jpgIf you use Windows XP Command prompt either for small or large tasks, one feature that is not enable by default is Automatic Completion. This feature will complete file and folder names automatically that you type at a command prompt and is real handy with folders that have a space in its name…


   
You can activate or deactivate this feature for a computer, or for only the current command session.

Current Session Activation

To activate Automatic Completion for the current session, open a Command prompt and type cmd /f. To use, type CTRL+D to complete a folder name or CTRL+F to complete a file name.

For example, to change to Documents and Settings folder, you can type at the prompt:

cd \doc

then press the Control key and the letter d

CTRL+D

The folder Documents and Settings will auto complete (with quotes since a space is included) and you can just press enter to change to the folder.

To display the contents of a text file, such as example.txt, you can type

type:exa

then press  CTRL+F.

The best feature is when there are multiple folders or files that match the characters you type, typing the control character (CTRL+F or CTRL+D) again displays the next matching instance. When the correct folder or file is displayed, press ENTER to complete the command. If no folder of file matches the characters that you type, you hear a beep.

If you do not know the names of folders or files in the current directory, you can just use CTRL+D or CTRL+F to list the contents of the folder with out first typing any characters.

To deactivate Automatic Complete for the current session, type cmd /f:off

TIP: If you use the file-completion control character with a command that works only with folders (for example, the cd or rd command), only folder names are searched.

Permanent Activation

If you enable Automatic Completion permanently, the feature is available to all users. However, you can deactivate the feature for any individual user, or you can use different control characters for that user than you applied to the computer. The user settings take precedence over the computer settings.

(WARNING:Use Registry Editor at your own risk. Always have a backup available)

Open regedit and follow these steps:

  1. Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor key.
  2. Click on the Command Processor key.
  3. For folder name completion, double-click the CompletionChar value. Type in 0×4 (for CTRL+D) in the Value data field and make sure Hexadecimal is selected. Click OK
  4.  For file name completion, double-click the PathCompletionChar value. Type in 0×6 (CTRL+F) in the Value data field and make sure Hexadecimal is selected. Click OK
  5. Close regedit.



Permalink • Print • Comment

Related Tech Tips

2 Comments on How To Enable Command Prompt Automatic Completion in Windows XP »

December 11, 2007

Marc @ 12:05 pm:

Thank you! I read thirty-five other articles before finding an answer that works! And it was short & simple!

Watching The Net @ 7:08 pm:

@Marc

Cool! Glad to help out.

Leave a Comment