Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to pass a tab character into a program from the command-line on Windows.

eg: grep "foo<TAB>bar" filename

However, cmd.exe's auto-completion gets in the way.

On Unix, you can hit Ctrl-V before the TAB to escape the special function of TAB.

In Powershell, `t is the escaped representation of TAB.

Does anyone know a way to do this for Windows' Command Prompt?

share|improve this question

If you start CMD with /F:ON it changes file completion to use ^F (which includes directories, while ^D does directories only) and makes Tab issue a tab character.

share|improve this answer

You could turn off tab completion, or change it to another character:

share|improve this answer
Yeah, I was hoping for something else. :-) – user63144 Dec 9 '10 at 19:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.