4

I created an AutoIt script that opens a certain app, and proceeds with a certain behavior. When I compile it, Autoit gives an executable file. If I run it, it works finely and smoothly.

Now: I need it to run sometime during the night, so I added it to the Windows Task Scheduler.

It didn't run.

I decided witnessing the process by changing the execution time, and, whenever it is time to run, sometimes (and ONLY sometimes) the icon pops up in the tray, but anyway nothing happens: no window gets opened and, well, the process does not run.

I have tried changing "run only when user is logged in" and using different user accounts but it doesn't seem to run correctly.

Some search around the Internet tells me that usually these tasks run in background, so no windows are actually opened. Well, then I need to do the opposite of that.

Any help is appreciated.

JD Gamboa
  • 143

2 Answers2

1

I actually run a compiled AutoIT script via Task Scheduler that does something similar as you describe and the only settings needed in Task Scheduler are:

  1. From the General tab check Run only when use is logged on and Run with highest privileges. The account that you use to run the job that executes the executable file will need to have permission to execute the file where it resides. To test these permissions are not a problem, just log in as that user, and then double-click on the executable file and confirm that you have permission to run it that way.

    i.imgur.com/rdCry0f.png

  2. From the Edit Action area be sure the Program/script field points to the full explicit path where the executable file resides. Also be sure the Start in field has the full path where the executable file resides with just the path only though. As long as you have this set as well as confirming the user running the process has permission to do so, then it should run as expected.

    i.imgur.com/k8c1QLy.png.


Further Resources

  • Check "some" of the detail on "Windows 10: Scheduled tasks with workstation lock/unlock not being triggered" in case any of this is applicable and you wish to double check for the applicable options only.

  • If you still have trouble, then it may be beneficial to see the AutoIT logic you are using to further troublshoot. The icon showing up in the task bar but not taking some action implies an AutoIT level issue potentially but when it does not pop up in that area at all, this would indicate a Task Scheduler level issue I believe.

0

I was facing this same problem, that when .exe were ran via task scheduler, some of the functions were failing (not all), but after defining my file path in that "Start in (optional)" -text field, all started to work out.

Thank you.

Robot
  • 1