how do I echo "%errorlevel%" to a file?
example:
echo if '%errorlevel%' == '0' (>>file.bat
I tried with ^ but it doesn't work.
This would help to solve my previous question.
Thank you
how do I echo "%errorlevel%"
Moderator: DosItHelp
Re: how do I echo "%errorlevel%"
Hi
The 1 before > means you want to write standard output
Have a look
or
Code: Select all
echo %errorlevel% 1>"file.bat"
The 1 before > means you want to write standard output
Have a look
or
Code: Select all
>"file.bat" echo %errorlevel%
Re: how do I echo "%errorlevel%"
thankyou, but what I want is literaly print the %errorlevel% word, not the value
so it can be readed correctly from the batch file I am creating.
the complete line is this:
thats the line I wanna put in the new batch, so I can call it later in the script
the batch I'm trying to print is this
viewtopic.php?f=3&t=2305
Muchas Gracias..... Thankyou
so it can be readed correctly from the batch file I am creating.
the complete line is this:
Code: Select all
if '%errorlevel%' == '0' (
thats the line I wanna put in the new batch, so I can call it later in the script
the batch I'm trying to print is this
viewtopic.php?f=3&t=2305
Muchas Gracias..... Thankyou
Re: how do I echo "%errorlevel%"
thank you, I could kiss you right now.......