Jump to content
Sign in to follow this  
McBrollocks

RunAsWait question

Recommended Posts

McBrollocks

Hi, in the code below, the 1st RunAsWait works fine (running a registry key that is included in the AutoIt executable)

But the second RunAsWait string just refuses to work, regardless of what I do with the logon_flag (I've tried all 4 values). Also, if you run the string in $KasperskyNAStr in a command prompt of OurDomain\admin, it executes, so the path and authentication are OK.

$WSUSStr = "regedit /s " & $WD & "/south-workstations-wsus3-regedit4.reg"

$KasperskyNAStr = '"\\server6.OurDomain.com\SHARE\Packages\NetAgent 6.0.1710\setup.exe " /S /v/qn'

RunAsWait ( "administrator", @ComputerName, $adminpasswd, 1, $WSUSStr, $WD, @SW_HIDE )

RunAsWait ( "admin", "OurDomain", "OurDomainPassword", 4, $KasperskyNAStr, $WD, @SW_MINIMIZE )

Any ideas would be very welcome!

Edited by McBrollocks

Share this post


Link to post
Share on other sites
PsaltyDS

Hi, in the code below, the 1st RunAsWait works fine (running a registry key that is included in the AutoIt executable)

But the second RunAsWait string just refuses to work, regardless of what I do with the logon_flag (I've tried all 4 values). Also, if you run the string in $KasperskyNAStr in a command prompt of OurDomain\admin, it executes, so the path and authentication are OK.

$WSUSStr = "regedit /s " & $WD & "/south-workstations-wsus3-regedit4.reg"

$KasperskyNAStr = '"\\server6.OurDomain.com\SHARE\Packages\NetAgent 6.0.1710\setup.exe " /S /v/qn'

RunAsWait ( "administrator", @ComputerName, $adminpasswd, 1, $WSUSStr, $WD, @SW_HIDE )

RunAsWait ( "admin", "OurDomain", "OurDomainPassword", 4, $KasperskyNAStr, $WD, @SW_MINIMIZE )

Any ideas would be very welcome!

Exactly how does it refuse to work? What are the failure indications, and what is the return value?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
McBrollocks

Exactly how does it refuse to work? What are the failure indications, and what is the return value?

:)

The return value is 0 and there is no error of any kind. But the setup.exe process from the network share doesn't start

Share this post


Link to post
Share on other sites
idbirch

On the machine which fails to run the 2nd RunAs, what happens if you run an Explorer instance with your Domain Admin account and then try accessing \\server6.OurDomain.com\SHARE\Packages\NetAgent 6.0.1710\? Is it actually reachable?

Share this post


Link to post
Share on other sites
McBrollocks

On the machine which fails to run the 2nd RunAs, what happens if you run an Explorer instance with your Domain Admin account and then try accessing \\server6.OurDomain.com\SHARE\Packages\NetAgent 6.0.1710\? Is it actually reachable?

Yes, it is reachable, not only for the Domain Admin account, but also for an ordinary user account which will be used to launch the exe I make with AutoIt.

(The setup.exe should then run under a Domain Admin account)

Share this post


Link to post
Share on other sites
99ojo

Yes, it is reachable, not only for the Domain Admin account, but also for an ordinary user account which will be used to launch the exe I make with AutoIt.

(The setup.exe should then run under a Domain Admin account)

Hi,

try this:

$KasperskyNAStr = '"\\server6.OurDomain.com\SHARE\Packages\NetAgent 6.0.1710\setup.exe" /S /v /qn'

In your string is a blank behind the setup.exe and a blank missing between /v and /qn. It's just a guess......

;-))

Stefan

Edited by 99ojo

Share this post


Link to post
Share on other sites
McBrollocks

Hi,

try this:

$KasperskyNAStr = '"\\server6.OurDomain.com\SHARE\Packages\NetAgent 6.0.1710\setup.exe" /S /v /qn'

In your string is a blank behind the setup.exe and a blank missing between /v and /qn. It's just a guess......

;-))

Stefan

Hi, thanks for that. The /v/qn (with no space) is how it should be.

The embarassing truth is that I missed something from the domain admin password in the script. It works fine now. Thanks for your suggestions.

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  

×