MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: SubString Extraction[Next]: Subroutines (common code)
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->Batch Files->Batch File Tips and Tricks->Special Characters (tabs etc)

Special Characters (tabs etc)

The following is a relatively simple way of using tabs or other characters within a batch file without the need for some other preinstalled "helper" program:

@echo off
setlocal
call :SetChar BEEP 7
call :SetChar TAB  9

set TabFile=NumberOfDumps@%date:/=-% %time::=_%.tab.txt
echo Column 1%TAB%Column 2%TAB%Column 3 > "%TabFile%
...
echo echo Beep!%BEEP%
goto :EOF

@REM **************[v08.178]******************
:SetChar
@REM *****************************************
    set VbsFile=%TEMP%\SetChar-%random%.vbs
    set CmdFile=%TEMP%\SetChar-%random%.cmd
    echo if Wscript.Arguments.Count ^<^> 2 then                                                                        > "%VbsFile%"
    echo    wscript.echo "REM Invalid parameters, expected 2 (1=EnvVar 2=AsciiCode), got " ^& Wscript.Arguments.Count >> "%VbsFile%"
    echo else                                                                                                         >> "%VbsFile%"
    echo    wscript.echo "@echo off"                                                                                  >> "%VbsFile%"
    echo    wscript.echo "SET " ^& Wscript.Arguments(0) ^& "=" ^& chr(Wscript.Arguments(1))                           >> "%VbsFile%"
    echo end if                                                                                                       >> "%VbsFile%"
    cscript.exe //NoLogo "%VbsFile%" "%~1" "%~2"                                                                       > "%CmdFile%"
    call "%CmdFile%"
    del "%VbsFile%" >nul 2>&1
    del "%CmdFile%" >nul 2>&1
    goto :EOF


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: SubString Extraction[Next]: Subroutines (common code)


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday August 29 2010 at 11:44am
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.