Scheduled tasks in Windows 7(64bit)

Asked by snoogins

Is there a way/program to schedule an executable .skl to run on Win 7? Task Scheduler doesn't seem to execute these scripts. I've tried to set passwords, use the Admin account, change the task to run as SYSTEM... nothing seems to run the scripts though they DO run when double clicked.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

In the scheduler use
Sikuli-IDE.bat younameit.skl
or
Sikuli-IDE-w.bat younameit.skl

BTW: a .skl is not really an "executable" in the sense of Windows, it is only a zipped version of the original script in its form as folder .sikuli
If you use the scripts for yourself, just stay with the folders .sikuli.
the the above usage is
Sikuli-IDE-bat (or Sikuli-Ide.bat) -r younameit.sikuli

One more thing:
When in the scheduler configuration window, the scripts can only be tested, when logged in as admin.

Revision history for this message
snoogins (adamdiaz84) said :
#2

Thanks for the clarification. It is a little confusing how the Sikuli scripts go into a folder with an apparent .sikuli extention. Can you explain which of these parts goes where into the scheduler? It looks like you gave me Program/Script, Arguements, and Start In data in one line.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Sorry, some typos.

If you want to use the .sikuli version of the script:

Sikuli-IDE.bat -r younameit.sikuli

or

Sikuli-IDE-w.bat -r younameit.sikuli

the first one (good for testing) leaves the command window open, whereas the second one closes it (so you will see no script output), so good for "production".

the above command might be added with the respective path information for the .bat and the .sikuli
You might also use the working directory specification in the task scheduler config

Revision history for this message
snoogins (adamdiaz84) said :
#4

I've tried to add:
   Sikuli-IDE.bat -r OpenMG.sikuli
to the Add Arguments textbox with no change in results. When double clicked, the file will run. When Manually ran through the Task Scheduler, I can see the cmd window flash on screen and disappear, Scheduler says Running, but no script is ran. When scheduled to run at a time, the cmd window blinks up and away, Scheduler says Ready (never says Running), and no script is ran.

The script I am testing is simple:
   popup("Test")

Is there a particular location for the all of the files? I have Sikuli installed in C:\Program Files (86)\Sikuli X , the script coding is in a folder in Documents, and the .skl is on my Desktop.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#5

I guess you have to give full path specs for the bat and the .sikuli and/or fill out the available path specifications in the task scheduler task setup.

Revision history for this message
snoogins (adamdiaz84) said :
#6

Thanks RaiMan, that solved my question.

Revision history for this message
snoogins (adamdiaz84) said :
#7

I've figured it out, thank you! I had to leave the account assigned to run the task as my own or Administrator, not SYSTEM. For the Program/Script text in the Actions tab, I used the full path for any of the three Sikuli .exe or .bat files:
     "C:\Program Files (x86)\Sikuli X\Sikuli-IDE.bat"
In the text area for Add Arguments, I used the full path to my .skl file:
     C:\Users\Mine\Desktop\untitled.skl

I don't know what the -r does, it seemed to work with and without the -r. It was the IDE.bat file that kept the cmd prompt window open.

Thanks again.