Also, point the scheduled task to the bat file you created in step 2 above and I would also check 'Run with highest priviliges'.Īlso, choose when/how this should be triggered (for example, when user logs on, at a certain time of day, when computer reboots, on logoff, etc.)Īs an example, if you want the scheduled task to run every 15 minutes every day you can set the following trigger:Ī) Daily at certain time of day (say 1:00pm)Ĭ) Select 'Repeat every 15 minutes for a duration of 1 day'Īlso, it has several advantages over what you were trying to do. IMPORTANT: Make sure ' Wake the computer to run this task' is selected.
Specify how often you want the task to be executed (e.g. java -cp )Ĭreate a Windows Scheduled Task (or Cron Job in Linux).
bat script that will call your program from command line (e.g. Basically refactor your program so that it executes a single task at a time.Ĭreate a simple Windows. Just execute once and let the program complete. In other words, if you have a while loop looping, then waiting N minutes, don't do that. Make your Java program executes just one unit of work.