Scheduling a job in windows from a java program.

hi all,

I have been trying to schedule a job ( creating a report) from a java application using the 'at' command. The syntax which i am using is something like this,

Runtime.getRuntime().exec("at 09:00 /EVERY java -cp C:\Vishal\lib\activation.jar;C:\Vishal\lib\adwords-0.7.jar;C:\Vishal\lib\mail.jar;C:\Vishal\; RepGen KeywordReport

where,

RepGen - is the class file to run

KeywordReport - Argument

The program runs perfectly without the 'at' command & is creating the report.

Once i use the at command , its not working.

Please can anyone help to fix this issue.

Thanks & Regards,

Vishal

[692 byte] By [vishal_vja] at [2007-11-26 16:30:56]
# 1

Have you configured the service account on your windows system?

In the Scheduled Tasks window, click on Advanced -> AT Service Account and check if you are using a valid service account (one that has the necessary privileges to run the operation).

Try replacing the command for your java app with notepad, and see if it pops up.

Also try running your AT command from the command prompt, and see what report you get.

I run the following command from a bat-file, and it works well (provided that I set my AT Service Account first):

at 18:00 /interactive /every:Monday,Tuesday,Wednesday,Thursday,Friday javaw -jar "e:\Programs\Backinup Palace\backinup.jar" "e:\Data\System\daily_backups.xml"

The /interactive switch is needed if your program has a UI.

GJosefa at 2007-7-8 22:55:25 > top of Java-index,Java Essentials,Java Programming...
# 2
I could not find the Advanced option in windows scheduled tasks. I am using Microsoft Windows 2000 machine. Once i open the scheduled tasks , it has only Add scheduled task & At1.job (job that i have scheduled) in it.I don't find any Advanced Option within this.
vishal_vja at 2007-7-8 22:55:25 > top of Java-index,Java Essentials,Java Programming...
# 3
Yeah i am sorry , i find that advanced tab in scheduled tasks . I have changed the default AT service account to my administrative account & now my scheduler is perfectly working fine. THANKS A LOT Josef !Regards,VishalMessage was edited by:
vishal_vja at 2007-7-8 22:55:25 > top of Java-index,Java Essentials,Java Programming...
# 4
Glad it helped!
GJosefa at 2007-7-8 22:55:25 > top of Java-index,Java Essentials,Java Programming...