Sign in to follow this  
Followers 0
kalahan55

Scheduling a script to run using Task Scheduler

2 posts in this topic

I am new to AutoIt and I am playing around to learn. I have created a script to do the following:

1) open MS Outlook.exe

2) start a new email message

3) have the script type the email address in the To; field (TAB x3)

4) type Subject and body of email

5) send email

6) close outlook and shutdown computer

I need all of this to happen while I am not present; in other words, I want to schedule the script to run at a later time, lock the computer and walk way. I tried using windows Task Scheduler and the script starts (I can see the AutoIt icon on the task bar at the bottom right-hand corner of the screen), but it freezes and does not complete the tasks and I have tried both with and without user authentication (i.e. entering my username and password in task scheduler when creating the task). I can get the script to perform the above tasks perfectly if I am logged in and watching it, but as soon as I lock my computer the task won't run. Please help me figure out how to schedule a script to run unattended.

Share this post


Link to post
Share on other sites



It probably has nothing to do with the scheduling. When the console is locked, no window can be active. You still might be able to send key strokes to a particular window, but you must use ControlSend() vice Send() to specify the target window.

Even better would be to learn to use the COM Object interface to Outlook, or use one of the existing UDFs. For example: Outlook UDF

:mellow:


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