jdunlop Posted June 28, 2017 Share Posted June 28, 2017 I inherited an AutoIT script that has been running ok for years on an Windows XP pc. It logs onto a SAP server and extracts data to a local file on the C: drive. Recently I moved the script to a Windows 8.1 PC and found that although I can run the script manually and it works fine, when it is added to a scheduler and run as a scheduled job, the code stops working and the program hangs. I have tried everything I can think of including changing the "Send" commands to ControlSend commands. I cannot figure out why the same code would work fine every time when run manually but when scheduled, it fails. Anyone have any ideas about this? Link to comment Share on other sites More sharing options...
water Posted June 28, 2017 Share Posted June 28, 2017 Welcome to AutoIt and the forum! As a scheduled job your script is being run with different credentials. So the problem you face might be caused by missing simple permissions. Add as much error checking to your script and log all results to a log file. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
jdunlop Posted June 29, 2017 Author Share Posted June 29, 2017 Thanks for your reply, water. Yes, I have done just that. I write to a logfile after every command and although I have now managed to get the script to complete, it doesn't execute correctly. It extracts data from a SAP database and creates a file on the C: drive but the file never gets created for some reason when run as a scheduled job. I understand that the job is run with different credentials but I can't see where Windows 8.1 would have the difference. Link to comment Share on other sites More sharing options...
water Posted June 29, 2017 Share Posted June 29, 2017 Hard to tell without having seen your script. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
jdunlop Posted June 29, 2017 Author Share Posted June 29, 2017 Solved it. Thanks, water, you put me on the right track. It turned out that the scheduler was running the job as a System task rather than a User task which was why the credentials were different. I changed it to a User task and it works ok. Thanks for your help. Link to comment Share on other sites More sharing options...
water Posted June 29, 2017 Share Posted June 29, 2017 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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