REM This batch file show how to
REM redirect errors I/O in batch scripts.
REM The I/O thread is being written
REM to the scecified file instead of the screen.
REM Insert this code at the beginning of your script
REM to redirect the I/O.
@ECHO off
IF EXIST %temp%\temp.cmd  DEL /q %temp%\temp.cmd
FOR /f "skip=6 tokens=*" %%i in (%0) do ECHO %%i >> %temp%\temp.cmd
CMD /c %temp%\temp.cmd > temp.log
IF EXIST %temp%\temp.cmd  DEL /q %temp%\temp.cmd
EXIT /b