I working on a small script here and I'm having trouble getting it to escape correctly.
Here's what I'm dealing with:
The part I'm having escaping issues with is the shutdown comment:
I can't seem to get it to escape correctly.
Any suggestions?
Here's what I'm dealing with:
Code:
SET strShutdownPath=%SystemRoot%\System32\
SET strShutdownProgram=shutdown.exe
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...
ECHO:
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...
)
Code:
-c \"%strShutdownComment%\"
Any suggestions?