Sign in to follow this  
Followers 0
jinbaba

AutoIt script as Windows Scheduled Task

12 posts in this topic

Hello Folks,

I have a autoIt script that I want to run daily on my Windows Vista. I compiled my script to executable and added it to scheduler it invokes my executable(Visible in task manager) but nothing is performed by my script. My script automates GUI operations of some bittorrent clients.

Any help?

Thanx,

JinBaba

Share this post


Link to post
Share on other sites



Hello Folks,

I have a autoIt script that I want to run daily on my Windows Vista. I compiled my script to executable and added it to scheduler it invokes my executable(Visible in task manager) but nothing is performed by my script. My script automates GUI operations of some bittorrent clients.

Any help?

Thanx,

JinBaba

By default, a scheduled task has no access to the desktop, so GUI functions don't work. I'm not sure how Vista controls granting interface to the desktop for a scheduled task.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I think there is an interactive switch that allows the task to interact with the desktop though.

Share this post


Link to post
Share on other sites

Scheduled tasks can interact with the desktop if this option is ticked, BUT the desktop they interact with is that of the useraccount under which they run. (default is system)

Thus to make this work you need to run the process under the user and password of the logged-on desktop. The danger here is that any change of logon or password will knock this out, so it's not a reliable arrangement. Best solution is to make the script run all the time, and 'schedule' itself.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hello,

Finally, there is a way to make AutoIt3 to interact with the desktop, when the AutoIt3 script is run through a scheduled task : psexec.exe, a PSTool

My script sauvegarde-BIAR.au3 does a BIAR export (Business Object database) by running an application that cannot be automated through command-line parameters (what a shame !). AutoIt3 scripts do not interact with the desktop when they are run from a scheduled task and when another user is already connected. I just create a scheduled task that runs this ms-dos batch file :

psexec -i -s "%~dp0autoit3.exe" "%~dp0sauvegarde-BIAR.au3"

-i indicates that psexec as to run with destop interaction and -s means that the command is run on the system account. Both parameters are mandatory to make this to work, even with a locked session.

PS : I do not have the opportunity to test the scheduled task with no session opened, but the should work to.

PPS : You have to run psexec.exe from a command-line once, because there is a EULA to accept.

Edited by chamach

Cervélo Soloist 2004 & Cervélo P3C 2007

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Try my TaskScheduler UDF. There are two versions, one written by me and one not. Use whichever you'd like. The link is in my signature.

Apart from telling that you can write a script, you did not say anything useful for anybody since the answer is in the previous message. :mellow:

Cervélo Soloist 2004 & Cervélo P3C 2007

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Apart from telling that you can write a script, you did not say anything useful for anybody since the answer is in the previous message. :)

apart from telling you that you are a dick, i found both yours and dbzfanatic's posts to be extremely helpful as will others im sure. thanks Edited by bluechipps

Share this post


Link to post
Share on other sites

PPS : You have to run psexec.exe from a command-line once, because there is a EULA to accept.

Just to add a note, you can add the /accepteula command to PSEXEC to bypass the EULA screen.

Share this post


Link to post
Share on other sites

Hi,

I am new to autoit and trying to automate the GUI operation of bittorrent client. Can you help me?

Hello Folks,

I have a autoIt script that I want to run daily on my Windows Vista. I compiled my script to executable and added it to scheduler it invokes my executable(Visible in task manager) but nothing is performed by my script. My script automates GUI operations of some bittorrent clients.

Any help?

Thanx,

JinBaba

Share this post


Link to post
Share on other sites

Hi,

I am new to autoit and trying to automate the GUI operation of bittorrent client. Can you help me?

Don't hijack existing topics.

Don't resurrect old topics.

Start your own topic for your issue.

:(


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0