kleysonr Posted December 5, 2014 Share Posted December 5, 2014 I have an autoit script that I need start it from the windows taskmanager. But every time I start the script it continue its execution only if I click in the windows program. I've tried a lot of things to bring the program to the top and set the focus, but nothing work. My last code to try do it was: Run('my_app.exe') Local $hWnd = WinWait('Program title') WinSetOnTop($hWnd, "", 1) WinWaitActive('Program title') WinActivate('Program title') ; To continue after this point I have to click in the my_app windows Send("{CTRLDOWN}i{CTRLUP}") (...) What do I have to do ? Regards. Kleyson Rios. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 5, 2014 Moderators Share Posted December 5, 2014 Why do you "need to start it from the windows taskmanager"? That makes no sense. If it is compiled into an executable, why can you not double click on it to launch? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
kleysonr Posted December 5, 2014 Author Share Posted December 5, 2014 Because the autoit script is part of an automated process that I need to run every day at night. I mean, a have a process to upload some files to the server at the end of day and at night my autoit script need read those files to do some operations. Link to comment Share on other sites More sharing options...
JohnOne Posted December 5, 2014 Share Posted December 5, 2014 Depends what your app is doing, if it is started by task manager then it becomes a child of task manager, if your app is trying to automate some admin stuff, then task manager would need to be running as admin. A non admin process cannot automate an admin process (> XP) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
kleysonr Posted December 5, 2014 Author Share Posted December 5, 2014 John, my script basically open an application, send some commands as, Send("{CTRLDOWN}i{CTRLUP}"), to import some files and extract some information. As I said in my first post, the script stop in the line "Send("{CTRLDOWN}i{CTRLUP}")", my application is opened, maximized and on top. But my script continue its execution only if I click on the application window to set the focus. Link to comment Share on other sites More sharing options...
jdelaney Posted December 5, 2014 Share Posted December 5, 2014 (edited) Unless you are logged in, and have the task run as 'logged in user', you'll have to take this into account: https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F There are ways around this with PAExec (freeware), as well...would still require a user session to be logged in. Edited December 5, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
JohnOne Posted December 5, 2014 Share Posted December 5, 2014 So use a mouseclick to click on it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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