juite_yang2000 Posted June 28, 2021 Share Posted June 28, 2021 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2021 Developers Share Posted June 28, 2021 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 Earthshine 1 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 comment Share on other sites More sharing options...
juite_yang2000 Posted June 28, 2021 Author Share Posted June 28, 2021 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; dailySummaryService_Final v2.au3 Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2021 Developers Share Posted June 28, 2021 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 comment Share on other sites More sharing options...
juite_yang2000 Posted June 28, 2021 Author Share Posted June 28, 2021 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. Link to comment Share on other sites More sharing options...
Earthshine Posted June 28, 2021 Share Posted June 28, 2021 (edited) 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 June 28, 2021 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
juite_yang2000 Posted June 29, 2021 Author Share Posted June 29, 2021 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 comment Share on other sites More sharing options...
Earthshine Posted June 29, 2021 Share Posted June 29, 2021 (edited) 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 June 29, 2021 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Zedna Posted June 30, 2021 Share Posted June 30, 2021 https://www.autoitscript.com/wiki/FAQ Why doesn't my script work on a locked workstation? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now