I have setup a few batch files to execute python scripts on window. I have confirmed the batch files work by double click them which lauches CMD to show the scripts running.
I have setup a task scheduler to kick off the batch files, and tested it by hitting the 'run' button on task scheduler GUI.
The EC2 instance is always up and running, but when I close my Remote Desktop application for the EC2 instance, the task scheduler does not kick off my scripts. What am I doing wrong? I want the task scheduler to run regardless if I can see the desktop or not.
I am using a mac to remote into the EC2 instance if that helps. Also very new to working with windows as indepth as this.
Thank you in advance.
Edit:
bat file settings:
@echo off
python C:\folder\folder\pythonscript.py %*
pause
Scheduler settings:
General Tab:
(checked) Run whether user is logged on or not
(checked) Run with highest privileges
Running as admin on local computer
Trigger Tab:
(checked) Daily
Recur every 1 day
(checked) repeat task every 1 min for duration 'indefinite" ----this is for testing
(checked) Enabled
Actions Tab:
Action: start a program
Program/script: C:\folder\bat_files\test.bat
Add Arguments(optional): blank
Start In(optional): blank
Conditions Tab:
(checked) start the task only if the computer is on AC power
(checked) Stop if computer switches to battery power
(checked) Wake the computer to run task
Settings Tab:
(checked) Allow task to be run on demand
(checked) Run task as soon as possible after schedule is missed
(checked) if task fails, restart every 1 min