Jump to content

Not able to run AutoIT program from Windows 10/7 task scheduler


Recommended Posts

Dear all,

I am new to AutoIT. 

Recently, I developed an AutoIT program and it ran normally manually. However, when I added it in Windows task scheduler, the task was initiated on time, but the program was not executed (as attached). 

Already tried different settings in scheduler, also try to use 'cmd' as program and '/c program_name.exe' argument. I just cannot make it run under scheduler.

Any help or advise?

Tks.

 

1.JPG

2.jpg

3.jpg

4.jpg

Link to post
Share on other sites
  • Developers

What exactly does the script do and show us the sourcecode please so we can check whether your used logic should work with the scheduler?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

Hi Jos,

Attached are related info.

Explained as below.

Tks.

- 'dailySummaryService_Final v2.au3' is the AutoIT program to be executed. I already compiled it into an executable named *.exe;

- I wrote a simple batch file 'aa.bat' to see what was going on when the task was initiated by scheduler:

1.jpg is the content of batch file;

2.jpg is the outcome when I ran 'aa.bat' in DOS window manually. the area marked in red box was what AutoIT program was supposed to generated;

3.jpg is the outcome when 'aa.bat' was started by scheduler. you can see the portion of AutoIT program was gone. In fact, no mail and Word document were generated as designed in the program;

1.JPG

2.jpg

3.jpg

dailySummaryService_Final v2.au3

Link to post
Share on other sites
  • Developers

I see there is desktop interaction (Send) in the script and the scheduled task runs without the user being logged on, so doubt that part will work.

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
3 hours ago, juite_yang2000 said:

Hi Jos,

I did not log off the computer all the time.

And, if it was caused by send(), there will be something else not related to send() to be executed. but, NONE.

Tks.

what does that mean exactly? What are you implying?

 

you script needs to have user logged in if you are going to use Send() keys. Not sure why you think this needs to execute via Task Scheduler

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to post
Share on other sites

Dear all,

What I meant is:

1. I logged into Windows and did not log off afterwards, just left the computer running as is. And, I still use that computer to do something else, like browsing or document preparation. Just added some scheduled tasks and expected them to be executed at specified timing at the same time;

2, if something wrong with a function like send(), at least other lines of code should be executed, like mouse moving at start of program. But, that was not the case. And, that was what I meant 'NONE' was executed;

3. If send() cannot be used in scheduled task, what should be used? controlsend()?

Many thanks.

Link to post
Share on other sites

show your autoit code. what isn't working and what you need it to do. the info you provided is useless for troubleshooting

ControlSend is ALWAYS better option as well

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...