Batch file redirection with numbers

Microsoft Windows 2003 server - 5 users
February 15, 2011 at 04:45:05
Specs: WIndows 2003 server
I'm created a batch file that will create two other batch files and then create a scheduled task to go with it.

My problem is with redirecting the echo of the "install.bat" to the two new files. Any line I have with a numeric at the end drops the number in the output file. If I put in a space, it outputs to the file, but includes a space that is messing up calculations in the new bat file. Example:
echo set /a counter+=1 >> c:\SystemHealth\dailyAverage.bat
will output to the new file, but add the space causing problems.
echo set /a counter+=1>> c:\SystemHealth\dailyAverage.bat
will be missing the 1 in the new file.

Is there a way to redirect the line without the trailing space and without losing the numeric?

See More: Batch file redirection with numbers

Report •

February 15, 2011 at 07:37:38
Embrace the line with left and right parenthesis () ever allowed, i.e.

echo (set /a counter+=1)>> c:\SystemHealth\dailyAverage.bat

Report •

February 15, 2011 at 10:28:15
that worked, thanks!

Report •
Related Solutions

Ask Question