Hello Experts Exchange
I have a batch file that I'm trying to run in Windows Server 2008 Task Scheduler, in Task Scheduler it report that the task run successfully, but the script should create a log file and no log file is created.
Here is the code I'm trying to run.
@REM *** START: Turns logging on ***
if "%~1" == "NOWLOGGING" goto NowLogging
%0 "NOWLOGGING" > "%SchedulesLogFile%" 2>&1
@REM *** END: Turns logging on ***
@rem Guts of batch file...
echo [%date% %time%] starting...
echo *** start of actual batch file...
echo *** end of actual batch file...
echo [%date% %time%] ending...
How do I resolve the problem?