I have a .cmd file (used to be a .bat file) with this in it:
echo %date% %time% > .\prebuild.log
echo Pre-Build Setup, Entry Code=%errorlevel% >> .\prebuild.log
if exist .\Debug\Exe\%1.Hex Del .\Debug\Exe\%1.*
echo Deleted DEBUG Files . . . >> .\prebuild.log
if exist .\Release\Exe\%1.Hex Del .\Release\Exe\%1.*
echo Deleted RELEASE Files . . . >> .\prebuild.log
::
:EXIT
::
echo Pre-Build Cleanup Complete, Exit Code=%errorlevel% >> .\prebuild.log
My output looks like this:
$ echo Pre-Build Setup, Entry Code=1 1>>.\prebuild.log
$ if exist .\Debug\Exe\apgatwoodv2.Hex Del .\Debug\Exe\apgatwoodv2.*
$ echo Deleted DEBUG Files . . . 1>>.\prebuild.log
$ if exist .\Release\Exe\apgatwoodv2.Hex Del .\Release\Exe\apgatwoodv2.*
$ echo Deleted RELEASE Files . . . 1>>.\prebuild.log
$ echo Pre-Build Cleanup Complete, Exit Code=1 1>>.\prebuild.log
$
Where is that "1" in front of the redirection characters coming from? It doesn't show up in my output file. Is there a better way to do this redirection? I'm asking because I'm running this script from inside an IDE and I'm getting odd results
that may or may not be related.
Thanks...