I have a batch file which name is "WatchDir.bat". The file is saved in c:\loadbo and it contains the following instruccions:
"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
Process is not running inside task scheduler