I have been working with Windows 7's command line and have some folders that begin with non-alphanumeric characters. When I try to use tab completion to complete the folder name, the initial character is not included inside of the quotation marks. Example: C:\Users\username\!example is the folder I want to get into, but when I type:

cd !

and press <Tab> to autocomplete, it will complete to

cd !"!example" 

instead of the expected

cd "!example"

Any ideas on how to fix this besides changing the folder names?

EDIT: I realize I could just tab through the entire list after entering cd, but I'm looking for a way to speed up the process. I have been spending a significant amount of time navigating these folders.

UPDATE: This also happens if there is a space in the directory. For example: "c:\Program Files". In order to continue using tab to complete, first the second quote has to be deleted.


press Tab

"C:\Program Files" is what appears. To navigate to a subdirectory, first the quote after Program Files has to be deleted before the next directory can be spelled out.

  • Still looking for help on this... – viking Jun 16 '11 at 19:55
  • In cmd, the ! is not recognised as the first character of file/dir. names, just like %, ^, &, ", /, +, (/), [/], {/}, ,, ;, =, ', ~, backtick (`) and space... – aschipfl Jul 13 '17 at 21:30

After much searching, I have a solution: Use Powershell. It is an advanced command-line tool with scripting language and is available on Windows 7.

Just type power into search on start and click the powershell icon (as illustrated). It might take a second to boot but it is a good utility.

enter image description here

Here is tabbing (cycling) through alphnumeric folders...

Power 2

P.s. Changing the functionailty of the command-line completion on ordinary CMD does not seem to be an option. You can only turn it on or off. The other alternative is to download a different SHELL (Console2 for instance) but Powershell works fine and should do all you need. For the name alone "PowerShell", it is pretty cool ;-)

  • Exactly what I was looking for. Solved both problems. Thanks for your help. – viking Jun 21 '11 at 14:54
  • @viking No probs....good luck – slotishtype Jun 21 '11 at 14:57


cd ^

followed by the tab key. You may have to then hit tab a few times to find the desired folder. Once you do and hit enter, it will change you into that directory.

The ^ key is the escape character for cmd.exe. For example, echo ^ vs echo ^^

  • That doesn't seem to change the behavior at all. – viking Jun 15 '11 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.