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.
(To learn how to use TAB autocomplete in Command Prompt, check out the examples provided at the end of this article.)
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 TAB Autocomplete
To enable the Command Prompt to autocomplete file and folder paths upon pressing the TAB key, follow these steps:
- Start the Registry Editor (
regedit.exe
) - Go to the following branch:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
(The user-specific settings underHKEY_CURRENT_USER
take precedence over the machine settings. So, you don’t need to repeat the setting under theHKEY_LOCAL_MACHINE
branch.) - Double-click
CompletionChar
and set its data to9
- Double-click
PathCompletionChar
and set its data to9
If the above registry values are missing, you’ll need to manually create the values (of type DWORD 32-bit) and set the data. Note that the value9
(0x9
) is the ASCII key code for the TAB key. - Exit the Registry Editor.
- Close and reopen Command Prompt for the change to take effect.
(Using command-line)
Alternately, to enable the Command Prompt TAB Autocomplete feature via command-line, use the following reg.exe
commands from a Command Prompt window:
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.
Important: If you start the Command Prompt using the CMD.EXE /F:OFF
switch, auto-completion using the TAB key won’t work, as the /F:OFF
switch it overrides the registry settings.
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 them.
Tips: How the Command Prompt TAB AutoComplete works
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
, 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
prog
and press the TAB key. It autocompletes the 1st folder name —Program Files
. - 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 —
ProgramData
Note that you need not be in the current directory. You can type the beginning of any folder path from any drive, like below:
![autocomplete path characters in command prompt](gif/cmd-autocomplete-path-4.gif)
You can also use Shift + TAB for cycling through 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.
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!
it took off the headache i had but did not fix the command line tab auto complete.