Running a JAVA program as a scheduled task

I Think that you could create a simple batch script that will launch your program in this way :

@echo off
REM Eventually change directory to the program directory 
cd C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\
REM run the program
"C:\Program Files\Java\jdk1.7.0\bin\java.exe" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"

Copy it into the notepad and save as java_script.cmd and then schedule this script instead of the program directly.

Leave a Comment