Sign in to follow this  
Followers 0
sekyao

RunAsSet with Win2000

7 posts in this topic

#1 ·  Posted (edited)

Hi, i have a problem here.

I have script below:

RunAsSet("administrator", @Computername, "mypassword")

; run as computer administrator

RunWait  ("newping.exe")

If FileExists("c:\accesslog\newping.exe") Then

  Run("d:\accesslog\newping.exe", "", @SW_HIDE)

else

  MsgBox(0, "ERROR For Program Setup", "Can Not Find Access Log Program!", 50) 

EndIf

RunAsSet()

what happen is that even though the username and password is correct, win2000 still ask for the option to "install the program as other user".

anyone have any idea on this issue?.

Sorry, but i'm still new in this scripting language.

edit:

I have double check and Secondary Logon is enable automatically.

Edited by sekyao

Share this post


Link to post
Share on other sites



This is from Autoit help file:

Remarks

This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator). The function only works on the 2000/XP (or later) platforms. NT4 users should install and use the SU command from the NT Resource Kit.

The "Secondary Logon service" or "RunAs service" must not be disabled if you want this function to work.

Share this post


Link to post
Share on other sites

This is from Autoit help file:

Remarks

This function allows subsequent Run and RunWait functions to run as a different user (e.g. Administrator). The function only works on the 2000/XP (or later) platforms. NT4 users should install and use the SU command from the NT Resource Kit.

The "Secondary Logon service" or "RunAs service" must not be disabled if you want this function to work.

<{POST_SNAPBACK}>

the script is executed from computer running windows 2000 pro OS , hence win2000. also i have checked and the secondary logon service is enabled.

Share this post


Link to post
Share on other sites

Opppsss....sorry...

I see you use @computername for domain...I think the parameter is for domain server, not computer name....

Share this post


Link to post
Share on other sites

Actually this field will work for either, depending on the situation. If you are attempting to RunAs a domain administrator then this needs to be a valid Domain Controller. If you are attempting to RunAs a machine administrator (of the specific machine the script is running on) then it is also fine if you use the computer name in this parameter.

Matt

Share this post


Link to post
Share on other sites

If you start a CMD-Shell (with /K and not @SW_HIDE) from your script, You may be able to make a further analysis interactively from the shell command line.

Share this post


Link to post
Share on other sites

okay. will modify the coding and try again. thanks for the help.

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  
Followers 0