I have a DOS batch file to run on a daily basis.
Something similar like -
@ECHO ON
SET COMMON_LIB=commons-io-1.3.1.jar;
SET AR_CLASS_PATH=%CLASSPATH%%COMMON_LIB%
java -cp %AR_CLASS_PATH% -Xms128m -Xmx256m FileCreating
PAUSE
When I run the batch file directly, i.e. double cliking on the .bat file, it runs fine, the command window opens up and executes all the required commands( note the PAUSE
).
But when I schedule a daily task, I see the status as Running. Also, when I right click on the task, it gives me an option to end the task(when status is Running
) but I cant see the command window and so I cant make out if it has been processed or the error it has generated.
And so, cant understand if the error is in classpath or my java code or somewhere else.
The environment is Windows Server 2003 R2 EE, SP2. The user has Admin priviledges.
I checked but there is no file of Schedlgu.txt in WINDOWS\Tasks
dir.
One thing I noticed was the CLASSPATH
value had no reference to the jdk/bin, can that be a issue?
Please advise.
EDIT
Just to simplify things, I commented the java
command for the bat file to do almost nothing then set some variables and then pause to keep the window open. Still no success.