Task Scheduler with Batch file

Ksean used Ask the Experts™
I have a batch file(*.bat) to run with Task Scheduler but I am getting error as below

Event ID 203
Task Scheduler failed to launch action "c:\windows\system32\cmd.exe" in instance

I have tried a couple of things but it still doesn't work

Thanks in advance
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Does the batch file run successfully when executed manually?

Then, in the section of task scheduler I also check the box "Run with highest privileges", though I don't know whether that would be necessary in your case.
Is this vista?

If the event id is 203, is the Error Value: 2147942667?

If so, then

Error code 2147942667 indicates that the directory name is invalid. In most cases, this is caused by placing quotes around the "Start In" directory.


Remove the surrounding quotes from the "Start In" path.

The path of the program to launch must be surrounded by quotes if it contains spaces; the "Start In" path must not be surrounded by quotes.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.


manually no problem. and also it is on windows 2008 server.

I do not have anything in Start in. Do I have to put anything?

batch file (file.bat) is in c:\program files\backup\backup.bat

When I put one command in program/script, no problem

but the batch file has many command inside.

If you could, could you please upload your batch file for me to see?


Here you are

@echo on
set JavaCmd1=Java -classpath . ServiceStat bodeans 3306
set JavaCmd2=Java -classpath . ServiceStat scandal 80
set JavaCmd3=Java -classpath . ServiceStat scandal 389
set DOSCmd=DIR C:\Windows

Set Counter=1
set Result=
for /f "tokens=1" %%a in ('!JavaCmd%Counter%!') do set Result=%Result%%%a

echo %Result%|findstr /i "yesyesyes"
if not errorlevel 1 GOTO DOCOMMAND

echo %Result%|findstr /i "errorerrorerror"
if not errorlevel 1 goto :EOF
echo %Result%|findstr /i "nonono"
if not errorlevel 1 goto :EOF
echo %Result%|findstr /e /i "no"
if not errorlevel 1 (
    echo %Time% started waiting 5 minutes...
    ping -n 300 loopback
    goto Loop
echo %Result%|findstr /e /i "yes"
if not errorlevel 1 Set /a Counter+=1
if %Counter% LEQ 120 goto Loop
sc start glassfishDomain1

Task Scheduler says it is running  but I never see dos windows that shows it is running

try echoing out to a text file to gauge progress while it's running.


Thanks for your help.
I just found solution myself. If I use option called "create basic task" instead of "create task", it just works
There may be some permission or security issues even though I used administrator for this task.
Thanks anyway

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial