Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

You could turn off tab completion, or change it to another character: http://www.gabrielserafini.com/blog/2004/10/26/windows-shell-auto-complete/

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

Your Answer

 
discard

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