Link to home
Start Free TrialLog in
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
ASKER CERTIFIED SOLUTION
Avatar of bit_rot
bit_rot
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmanzo20
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial