azz_kikr Posted February 3, 2005 Posted February 3, 2005 i have to isntall certain apps on on like 500 computer now there are several differect admin accout/passwords. Can any1 point me into the right diretion on how to craete ceratin script. i got his far but it always gives me a incorrect password/username error and it doesnt try the other passwords any help will be appreciated expandcollapse popup$TMPDIR = "d:\Test" $ALLUSERSPROFILE = EnvGet ( "ALLUSERSPROFILE") dim $Administrator[4] dim $Paswoord[3] $Administrator[0] = String("Administrator") $Administrator[1] = String("Admin") $Administrator[2] = String("Administrateur") $Administrator[3] = String("Beheerder") $Paswoord[0]= String("pasword") $Paswoord[1]= String("test") $Paswoord[2]= String("test2") dim $LoginOk $SourceDir = "\\xx.xx.xx.xx\Anonymous\" $AppName = "apps.exe" InstallServer() ;Einde Exit Func InstallServer() DirCreate ( $TMPDIR & "\" & "Temp" ) FileCopy ( $SourceDir & $AppName, $TMPDIR & "\Temp\", 1) for $i = 0 to 3 for $j = 0 to 2 Runasset($Administrator[$i], @computername, $paswoord[$j]) runwait($TMPDIR & "\" & "Temp\" & $AppName) if @error <> 0 Then MsgBox(16, "Error Logon", "Unable to logon. " & $LoginOk & $Administrator[$i] & $paswoord[$j] & @computername ) else MsgBox(64,"Wheee","Yes" & $LoginOk & $Administrator[$i] & $paswoord[$j] & @computername ) runwait($TMPDIR & "\" & "Temp\" & $AppName) exitloop 2 endif Next Next Runasset() ;Sleep ( 2000 ) ;DirRemove ( $TMPDIR & "\" & "Temp", 1) EndFunc
SlimShady Posted February 3, 2005 Posted February 3, 2005 (edited) Add this somewhere at the top. Opt("RunErrorsFatal", 0) A suggestion: This doesn't look very clear: if @error <> 0 Then Change it to this: if @error Then Edited February 3, 2005 by SlimShady
sugi Posted February 3, 2005 Posted February 3, 2005 Be careful when trying that much passwords on an account. You could lock the admin account.
CyberSlug Posted February 3, 2005 Posted February 3, 2005 Runasset($Administrator[$i], @computername, $paswoord[$j]) runwait($TMPDIR & "\" & "Temp\" & $AppName) You need to check the return value (or is it @error flag?) of the RunAsSet BEFORe calling RunWait. If RunAsSet fails, the runwait could potentially hang. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
SlimShady Posted February 3, 2005 Posted February 3, 2005 (edited) @Cyberslug:Did you check the RunAsSet documentation?Return ValueReturns 0 if the operating system does not support this function.Otherwise returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....)That's why they implemented the option RunErrorsFatal.So @error is set when the Run* function fails. Edited February 3, 2005 by SlimShady
CyberSlug Posted February 3, 2005 Posted February 3, 2005 @Cyberslug:Did you check the RunAsSet documentation?Oops. This is really embarassing since I wrote the remarks section for the RunAsSet docs :"> Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
azz_kikr Posted February 7, 2005 Author Posted February 7, 2005 Oops. This is really embarassing since I wrote the remarks section for the RunAsSet docsĀ :"><{POST_SNAPBACK}>thanks guys that fixed it
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