The Command Prompt has a handy little feature that lets to change directory paths using autocomplete. To change to a directory or type a directory name, you can type the starting letters of the directory and press the TAB key to autocomplete the file or folder path.
For example, to change to the directory named
Program Files, from the C:\ prompt, simply type
cd prog and press the TAB key. The Command Prompt autocompletes the directory name automatically. The autocomplete feature automatically encloses file/folder names in double-quotes if it contains one or more spaces.
Cycle through folder names using TAB
However, if there are multiple folders whose name start with
Prog — then pressing TAB once will autocomplete the first folder name that begins with
Prog. Subsequent TAB presses will cycle through the remaining matching folder names.
For example, you have three folder names that start with
Prog on the C:\ drive —
Program Files (x86) and
ProgramData. Let’s say you want to switch to
ProgramData on the
C:\ drive using the autocomplete feature.
- From the C:\ prompt, type
progand press the TAB key. It autocompletes the 1st folder name —
- Press the TAB key again to autocomplete the 2nd folder name —
Program Files (x86)
- Press the TAB key again to autocomplete the 3rd folder name —
Note that you need not be in the current directory. You can type the beginning of any folder path from any drive, like below:
You can also use Shift + TAB to cycle the folder names in reverse alphabetical order.
Another example would be to list the directory contents of
Program Files (x86). To do so, from the C:\ prompt, type
dir prog and then press the TAB key (twice) to autocomplete the
Program Files (x86) folder name.
File and folder paths autocomplete feature is enabled by default in Windows 10. But if it stops working for some reason, this article tells you how to fix it.
How to Enable Command Prompt Autocomplete Path if it stops working
To enable the Command Prompt to autocomplete file and folder paths, follow these steps:
- Start the Registry Editor (
- Go to the following branch:
CompletionCharand set its data to
PathCompletionCharand set its data to
If the above registry values are missing, you’ll need to create the values (of type DWORD 32-bit) manually, and set the data. The hexadecimal value
0x9) is the ASCII key code for the TAB.
- Exit the Registry Editor.
- Close and reopen Command Prompt for the change to take effect.
To enable the Command Prompt autocomplete feature using command-line, use the following
reg add "hkcu\software\microsoft\command processor" /v CompletionChar /d 9 /t REG_DWORD /f reg add "hkcu\software\microsoft\command processor" /v PathCompletionChar /d 9 /t REG_DWORD /f
Close and reopen Command Prompt for the change to take effect.
Typing the complete folder path manually is an annoying task. The Command Prompt file and folder name autocomplete feature is convenient, especially when dealing with long folder names or when the folder names have version numbers in it.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.