singbass Posted September 30, 2013 Share Posted September 30, 2013 I have searched the forums and tried a few things but still haven't found a solution. I also have our local Network Support guys looking into this. I dont think it is an AutoIT issue but there is a wealth of knowledge out here in the forum and maybe someone has run across this in the past. I have a very simple script; #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #RequireAdmin If IsAdmin() Then MsgBox(0, "", "Admin rights detected") $param1 = $cmdline[1] $param2 = $cmdline[2] MsgBox(0,"","Parameter 1 = " & $param1 & @crlf & "Parameter 2 = " & $param2) I tried to set up a scheduled task and pass the parameters as arguments but it just hangs in a running state. I don't even get the first Message Box that says 'Admin rights detected'. I then set up a .bat file as shown below; \\ilxap-cmscript\e$\Scripts\In_Development\cold2_x64.exe "SJS" "123" I can run the .bat file and get each MsgBox returned. I then tried to set up a scheduled task calling the .bat file and still get nothing. That's why I think this is not and AutoIT problem. The server is running Windows Server 2008 R2 Enterprise, SP1, 64 bit. I have tried compiling as both x86 and x64 and neither works. I am doing everything remotely. I RDP to the server using the service account that everything runs as. I then set up the scheduled tasks as that same user. That's where I also go to run the .bat file manually. Can anyone shed some light on this? Is there something different I need to be doing for Win 2008 Server? Link to comment Share on other sites More sharing options...
water Posted September 30, 2013 Share Posted September 30, 2013 Is the scheduled task configured to interact with the desktop? 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...
water Posted September 30, 2013 Share Posted September 30, 2013 The exe you call seems to be located on another server (ilxap-cmscripte$). Does the System Account have permission to access this share? 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...
singbass Posted September 30, 2013 Author Share Posted September 30, 2013 Not sure about the desktop. If you mean is the 'Hidden' box checked in the General tab, the answer is no. However, I do want this to be able to run if the user is not logged in. When passing scripts, does the user account have to be logged in to the box for it to work? I have many scripts that access file shares running from a box where the user account is not logged on but the user account does have rights to the shares. As for the UNC path, everything is on the same box. I just always use UNC path so it can run from other locations if necessary. Link to comment Share on other sites More sharing options...
water Posted September 30, 2013 Share Posted September 30, 2013 The user doesn't have to be logged on for the scheduler to run the script. To Debug your script I would write some log records to a file. This should be the first statement in your script so you know the script started to run successfully. Then before and after each important statement. 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...
singbass Posted September 30, 2013 Author Share Posted September 30, 2013 That was next on my list. When you mentioned interaction with the desktop, I knew there wouldn't be a desktop if the user wasn't logged in, I just didn't know if it was a requirement in order to use parameters. Link to comment Share on other sites More sharing options...
water Posted September 30, 2013 Share Posted September 30, 2013 Not to use parameters but to display the MsgBox you have in your OP. 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...
Solution singbass Posted October 1, 2013 Author Solution Share Posted October 1, 2013 As I figured, it appears it's a Win 2008 issue. Finally found the fix in another forum, deep within the thread. Had tried everything mentioned up to that point with no luck. Finally found the anwer. http://social.technet.microsoft.com/Forums/windowsserver/en-US/d47d116e-10b9-44f0-9a30-7406c86c2fbe/scheduled-task-wont-run-bat-file Thanks. 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