Avatar of jmanzo20
jmanzo20
 asked on

Process is not running inside task scheduler

I have a batch file which name is "WatchDir.bat". The file is saved in c:\loadbo and it contains the following instruccions:

cd \loadbo
"C:\Program Files\Java\jdk1.7.0\bin\java"  WatchDir c:\loadbo\inFile

The program "WatchDir" is a java program which monitors a folder for new file creation. If a new file is created in c:\loadbo\infile, then a second batch file is executed (c:\loadbo\copyfile.bat)


If the program WatchDir.bat is run in console mode, everything works fine and I can see that the process continues running using taskmgr. The process keeps running because the java code is monitoring new file creation inside c:\loadbo\infile\.

The problem appears when I try to schedule the Watchdir.bat using task scheduler. Nothing happens, the process does not run even when the screen shows that the process is "executing". I have changing the frequency from executing at startup, execute each minute, etc. without success.

What may be happening?

My OS version windows server 2008 R2
JDK 7 for x64
CLASSPATH includes c:\loadbo
PATH includes c:\loadbo and "C:\Program Files\Java\jdk1.7.0\bin\"

Thank you for your help

Jorge Manzo



Process is not running inside task scheduler
Microsoft Legacy OSMicrosoft ApplicationsServer Software

Avatar of undefined
Last Comment
Tony Giangreco

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
bit_rot

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Brian Pringle

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
jmanzo20

ASKER
Thank you.

The service for task mgr is running because I have other scheduled processes working fine.

I am using the GUI in order to schedule the task and I am using admin privileges and admin password. But, nothing changes.

In the GUI, I executed my process but if I try to see it running in taskmgr, it is not running.

One issue I did not mention; I have two Java JDK version on the same server, the JDK7 for x32 and JDK 7 for x64. But the batch file and path only make reference to JDK 7 x64 path.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Your help has saved me hundreds of hours of internet surfing.
fblack61