To sucessfully make batch files from batch files, you need to employ the escape character ^
instead of
Code:
echo.START /max %ComSpec% /c "%Temp%\md5.exe"
use
Code:
echo.START /max ^%%ComSpec^%% /c ^"^%%Temp^%%\md5.exe^"
(percent signs like to be odd in batch)
EDIT:
just saw part about ping :
again use
Code:
echo.Ping localhost -n 1 -w 1 ^>nul
I also removed the return carriage after the block b/c that changed the file being written to . . .
end code should look like:
Code:
>Main.bat (
echo.@ECHO OFF
echo.CLS
echo.TITLE Test Batch
echo.START /max ^%%ComSpec^%% /c ^"^%%Temp^%%\md5.exe^"
echo.Ping localhost -n 1 -w 1 >nul
echo.EXIT
)>>NewFile.bat
type NewFile.bat