JSI Tip 6968. How do I echo a tab character in a batch file?

To echo a tab character in a batch file:

1. Edit your batch file in Notepad.

2. Depress the Tab key in the appropriate places in your echo command line.

Example:

If you type the following, replacing each occurance of <TAB> with the Tab key:

@echo %computername%<TAB><TAB><TAB>%UserName%<TAB><TAB><TAB>#

The following should be displayed:

JSI009                  Jerry                   #



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish