Jump to content
Sign in to follow this  
singbass

Parameters & Windows 2008

Recommended Posts

singbass

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?

 

 

Share this post


Link to post
Share on other sites
water

Is the scheduled task configured to interact with the desktop?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
singbass

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.

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
singbass

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.

Share this post


Link to post
Share on other sites
water

Not to use parameters but to display the MsgBox you have in your OP.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

×