|I working on a small script here and I'm having trouble getting it to escape correctly.Here's what I'm dealing with:|
SET strShutdownComment=A shutdown has been initiated. The system will shutdown in thirty (30) seconds.
IF EXIST "%SystemRoot%\System32\schtasks.exe" (
ECHO Program Found, Executing Command...
SCHTASKS /Create /RU "SYSTEM" /SC DAILY /TN "Computer Shutdown" /TR "%strShutdownPath%%strShutdownProgram% -s -t 30 -c \"%strShutdownComment%\" -f" /ST "23:00:00" /SD "01/01/2001"
) ELSE (
ECHO Program NOT Found, Ending Script...
The part I'm having escaping issues with is the shutdown comment:
I can't seem to get it to escape correctly.