Jump to content

Parameters & Windows 2008


singbass
 Share

Go to solution Solved by singbass,

Recommended Posts

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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Solution

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...