sekyao Posted December 13, 2004 Share Posted December 13, 2004 (edited) Hi, i have a problem here.I have script below:RunAsSet("administrator", @Computername, "mypassword"); run as computer administratorRunWait ("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) EndIfRunAsSet()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 December 13, 2004 by sekyao Link to comment Share on other sites More sharing options...
stingjoel Posted December 13, 2004 Share Posted December 13, 2004 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. Link to comment Share on other sites More sharing options...
sekyao Posted December 13, 2004 Author Share Posted December 13, 2004 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. Link to comment Share on other sites More sharing options...
stingjoel Posted December 13, 2004 Share Posted December 13, 2004 Opppsss....sorry... I see you use @computername for domain...I think the parameter is for domain server, not computer name.... Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted December 13, 2004 Share Posted December 13, 2004 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 Link to comment Share on other sites More sharing options...
kanumi Posted December 13, 2004 Share Posted December 13, 2004 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. Link to comment Share on other sites More sharing options...
sekyao Posted December 14, 2004 Author Share Posted December 14, 2004 okay. will modify the coding and try again. thanks for the help. 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