I need reliable way to create %tab% (containing one tab character) for both, Windows and XP.
SET TAB=" "
Should work for Windows 7 (not tested) but not for Win XP (tested).
This
for /F "skip=4 delims=pR tokens=1,2" %%a in ( 'reg query hkcu\environment /v temp' ) do set TAB=%%b
works for Win XP only.
Open multiple command prompts in Windows 10Click Start, type cmd, and press Enter to open a command prompt window. In the Windows taskbar, right-click the command prompt window icon and select Command Prompt. A second command prompt window is opened.
The Command Tab comprises an edit box and allows the execution of OS commands. The output of the same is available above the edit box. To activate the Command Window edit box, press Ctrl + E or go to View > Command Window.
Open a new tab Windows & Linux: Ctrl + t. Mac: ⌘ + t.
You should use an editor which supports TAB characters without changing them to spaces.
And you should reorder the quotes, as with set TAB=" "
you got a variable with three characters.
TAB contains then also the quotes.
set "TAB= "
Currently there seems to be no reliable way to use a program to create a TAB character in all Windows versions on all language platforms.
But you could also use an embedded Jscript snippet.
@if (@X)==(@Y) @goto :Dummy @end/* Batch part
@echo off
SETLOCAL ENABLEEXTENSIONS
for /f "delims=" %%x in ('cscript //E:JScript //nologo "%~f0"') do set TAB=%%x
echo Tab character is "%tab%"
goto :EOF
***** Now JScript begins *****/
WScript.Echo(String.fromCharCode(9));
With robocopy TAB can also be generated. Robocopy is not available in windows xp by Default.
for /f "delims= " %%T in ('robocopy /L . . /njh /njs') do set "TAB=%%T"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With