Concatenate a variable with a string
- by user311130
Hello all,
I wrote a small bat file:
@echo off
rem runs the {arg[0].exe} - using its fully qualified name
%~f1
IF %errorlevel% NEQ 0
(set boolResult=False)
ELSE
(set boolResult=True)
rem case1
EVENTCREATE /T ERROR /ID 700 /L "MyTest Application" /D "exitcode: %errorlevel%; session id is %SessionName%"
rem case3
EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %boolResult%; session id is %SessionName%"
rem case4
EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %errorlevel%; session id is %SessionName%"
And I have got some questions, if you could help me out...
case1: I get the following error:
ERROR: 'MyTest Application' log does not exist. Cannot create the event.
*The only way to initial eventlog in through high-leve (c#) code?
case3: How can I concatenate a string with some bat variable ?
case4: How do I add a newline in the description?
"exitcode: %boolResult%\n session id is %SessionName%"
didn't do that.
Thanks for any assistance