sergioneri Posted October 23, 2015 Share Posted October 23, 2015 (edited) hi,I'm new using autoit, I'm just using this tool to download some reports every 30 minutes, this I what I have:#include <IE.au3> Call ("SignIn") Func SignIn () Global $oIE = _IECreate ("http://url.com") Local $username = _IEGetObjByName($oIE, "username") Local $password = _IEGetObjByName($oIE, "password") Local $button = _IEGetObjByName($oIE, "submitFrmShared") _IEFormElementSetValue ($username,"administrator") _IEFormElementSetValue ($password,"Pa55word") _IEAction ( $button, "click") Call ("copytext") EndFunc Func copytext () WinWait('File Download') WinActivate('File Download') Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{Enter}") WinWait('Save As') WinActivate('Save As') Send("C:\reporttest.csv") Send("{Enter}") Sleep(10000) RunWait('taskkill /F /IM "iexplore.exe"') EndFuncBasically I access to the report url using my credentials, then I start the download and use the keyboard to save the file on the disk C: .If I click on the generated .exe the script works fine and downloads the report but if I use the task scheduler and configured a task to run the exe whether user is logged on or not, nothing happens( if I use the option run only when user is logged on runs perfectly but that's not the option I'm looking for), the problem is I see internet explorer process running on the windows task manager but the task on the task scheduler never ends but I'm not sure what could be the problem, any possible solution to this? I read about InetGet and I made a test but didn't work, not sure if the problem is I start with an authentication before I download the reports.Any help would be appreciated,Thanks and regards, Sergio. Edited October 23, 2015 by Jos Added codebox Link to comment Share on other sites More sharing options...
Danp2 Posted October 23, 2015 Share Posted October 23, 2015 https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3FHave you considered using InetGet to download the file instead of trying to click the browser buttons? Latest Webdriver UDF Release Webdriver Wiki FAQs 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