0

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?

2 Answers2

4

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.

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
0

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

simon
  • 714
  • 1
  • 7
  • 21