New
#1
Windows 10 Scheduled Task only runs batch file if I am logged on
Windows version: 10
I wrote a batch file that will update files in one of my directories. The batch script references a Java class app I wrote. The class works on its own; the batch script works on its own. I created a Windows Scheduled Task to run the batch script every day at 9am. If I am logged in on my laptop, the scheduled task runs, and the files are updated. If I am not logged in on my laptop, the scheduled task appears to run (according to the history), but the files are never updated. If I manually run the scheduled task, it runs, and the files are updated. I made sure to perform every step that I read I am supposed to do:
- I created the task with the user "NT AUTHORITY\SYSTEM"
- I clicked "Run if the user is logged in or not"
- I added SYSTEM and myself as users under Security Policy > Security Settings > Local Policies > User Rights Assignment > Log on as a batch job
- I ensured that the batch script would go to the directory where the batch script resides before running the remainder of the script
The batch script:
I don't know what else to do, and I have done extensive research into this issue to no avail. Is there something else I would need to do? Please advise, thanksCode:ECHO Running DandyLabsBlogEntryRetriever.. SET myPath=C:\users\phill\OneDrive\Desktop SET classes=%myPath%\classes CD %myPath%\batch "C:\Program Files\Java\jdk-14.0.1\bin\java" -cp "%classes%;%myPath%/jar/commons-io-2.11.0.jar;%myPath%/jar/mysql-connector-java-8.0.19.jar" com.dandylabs.DandyLabsBlogEntryRetriever && ( (call) ) || ( (call) )