Do you use the command line daily? If so, I recently found a way to enable autocomplete for the command line using a simple registry edit. When entering a long path, just enter the first few letters and then press TAB to autocomplete folder or file names.
For example, if I’m typing to C: Documents and Settings , I just need to type C: Doc and then press the TAB key.
As you can see, there is only one folder that starts with “doc” so it is automatically terminated by adding quotation marks. It’s pretty neat. If you want to continue, just add another at the end and press TAB. Note that you can add a forward slash after the quote and it will still work fine.
You can continue browsing through the various folders and files in a directory simply by pressing the TAB key. Therefore, if you enter C: and then continue to press the tab key, you can cycle through all the folders and files in that path in alphabetical order, i.e. C: Documents and Settings, C: Program Files , etc. etc.
Note that this really only applies to Windows XP. On Windows 7 and later, autocomplete will work automatically when you press the TAB key.
Enable command prompt auto-completion
Step 1. Click “Start” then “Run” and type regedit in Windows XP. On Windows 7 and newer, just click Start and type regedit.
Step 2. Navigate to one of the following registry keys. :
HKEY_LOCAL_MACHINE SOFTWARE Microsoft Command Processor
HKEY_CURRENT_USER SOFTWARE Microsoft Command Processor
So which one to choose? Well, this is how it works. The local computer key will apply to all users on the computer, but will be overridden by the current user key if the value is different. For example, if autocomplete is disabled for the HKLM key, but enabled for the HKCU key, then it will be enabled. You can tell if autocomplete is turned off by simply inserting a TAB space when you press the TAB key.
You can change the settings in both places if you like, but in fact it is only needed in the HKCU key to enable autocomplete.
Step 3: Double-click the CompletionChar button and change the value to 9 in decimal format. CompletionChar enables folder name completion.
You can also enable filename completion by also changing the PathCompletionChar value to 9. Note that 9 or 0x9 in hex is used to use the TAB control character for autocomplete. You can also use other keys if you like.
For example, you can use 0x4 for CTRL + D and 0x6 for CTRL + F. I personally think the TAB key is the most intuitive key, but you have other options if you need to.
You can also use the same control character to complete files and folders if you like. In this case, autocomplete will show you all matching files and folders for the given path.
As mentioned earlier, the default on Windows 7, Windows 8 and above is 0x40 (64 decimal) in the HKLM key. By default, the HKCU key should be set to 0x9 (9 in decimal), which means it will be enabled. If not, you can manually change it.
Overall, this is a great time saver for those who have to type a lot of DOS commands. If you have any questions, do not hesitate to leave comments. Enjoy!