PC.Guru.01 Posted September 19, 2007 Share Posted September 19, 2007 (edited) Hello... I am trying to install an application as the "LocalAdmin" account on our workstations but since the XP Upgrade, we have a MIXED environment of 2 localadmin passwords. One was the Win2K Password & now the new format for XP to meet the XP credentials. For some reason, I can't seem to get my script to work properly. If the 1st password is correct, then it will continue forward. However, if it fails on the 1st login, it seems to NOT go to the next password. It looks fine and I have tried debugging but no errors.Could someone look at my code and see what I am missing? ; Login to Local Administrator Account but if it fails on the 1st password(OLD Win2K Password), it will try the 2nd password (NEW XP Password) Opt("RunErrorsFatal", 1) ; 1=fatal, 0=silent set @error RunAsSet("localadmin",@ComputerName,"Win2KPass") If @error Then RunAsSet("localadmin",@ComputerName,"XPPass") Exit EndIfThis has been driving me crazy... Edited September 19, 2007 by Lori Wood Link to comment Share on other sites More sharing options...
Nahuel Posted September 19, 2007 Share Posted September 19, 2007 Why did you post this FIVE times?! Link to comment Share on other sites More sharing options...
PC.Guru.01 Posted September 19, 2007 Author Share Posted September 19, 2007 Why did you post this FIVE times?!I didn't, I just edited my post to correct the script Link to comment Share on other sites More sharing options...
Monamo Posted September 19, 2007 Share Posted September 19, 2007 Hello... I am trying to install an application as the "LocalAdmin" account on our workstations but since the XP Upgrade, we have a MIXED environment of 2 localadmin passwords. One was the Win2K Password & now the new format for XP to meet the XP credentials. For some reason, I can't seem to get my script to work properly. If the 1st password is correct, then it will continue forward. However, if it fails on the 1st login, it seems to NOT go to the next password. It looks fine and I have tried debugging but no errors. Could someone look at my code and see what I am missing? ; Login to Local Administrator Account but if it fails on the 1st password(OLD Win2K Password), it will try the 2nd password (NEW XP Password) Opt("RunErrorsFatal", 1) ; 1=fatal, 0=silent set @error RunAsSet("localadmin",@ComputerName,"Win2KPass") If @error Then RunAsSet("localadmin",@ComputerName,"XPPass") Exit EndIf This has been driving me crazy... If it's proceeding to the second user/password set, you're exiting immediately instead of progressing to the rest of the script... If @error Then RunAsSet("localadmin",@ComputerName,"XPPass") Exit EndIf - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
Erik. Posted September 19, 2007 Share Posted September 19, 2007 (edited) Srry wrong one Edited September 19, 2007 by Erik. I little problem, hard to find and fix Link to comment Share on other sites More sharing options...
Developers Jos Posted September 19, 2007 Developers Share Posted September 19, 2007 (edited) Hello... I am trying to install an application as the "LocalAdmin" account on our workstations but since the XP Upgrade, we have a MIXED environment of 2 localadmin passwords. One was the Win2K Password & now the new format for XP to meet the XP credentials. For some reason, I can't seem to get my script to work properly. If the 1st password is correct, then it will continue forward. However, if it fails on the 1st login, it seems to NOT go to the next password. It looks fine and I have tried debugging but no errors. Could someone look at my code and see what I am missing? ; Login to Local Administrator Account but if it fails on the 1st password(OLD Win2K Password), it will try the 2nd password (NEW XP Password) Opt("RunErrorsFatal", 1); 1=fatal, 0=silent set @error RunAsSet("localadmin",@ComputerName,"Win2KPass") If @error Then RunAsSet("localadmin",@ComputerName,"XPPass") Exit EndIf This has been driving me crazy... RunAsSet() will not login nor check the credentials if they are correct. You need to use RunWait() to validate that. Jos Edited September 19, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PC.Guru.01 Posted September 19, 2007 Author Share Posted September 19, 2007 If it's proceeding to the second user/password set, you're exiting immediately instead of progressing to the rest of the script... If @error Then RunAsSet("localadmin",@ComputerName,"XPPass") Exit EndIfI appreciate the quick response on this. I tried moving the EXIT to the end of the script but I am still getting the following error: CitrixClientInstall_test.au3 (10) : ==> Unable to execute the external program.: Run(@TempDir & "\ICAWeb32T.exe /s",@TempDir) Logon failure: unknown user name or bad password.Here is a copy of my full code: ;Login to Local Administrator Account but if it fails on the 1st password(OLD Win2K Password), it will try the 2nd password (NEW XP Password) Opt("RunErrorsFatal", 1) ;1=fatal, 0=silent set @error RunAsSet("localadmin",@ComputerName,"Win2KPass") If @error Then RunAsSet("localadmin",@ComputerName,"XPPass") EndIf ;Download Citrix Web Client from the web and saves it to the C Drive If InetGet("http://na.hmcs.gm.com/Citrix/ICAWEB/en/ica32/ica32t.exe", @TempDir & "\ICAWeb32T.exe",1) then Run(@TempDir & "\ICAWeb32T.exe /s",@TempDir) Else MsgBox(0,"","Download Failed") EndIf Exit ; Install Citrix Web Client WinWaitActive("Citrix ICA Web Client") Send("{Enter}") WinWaitActive("Citrix License Agreement") Send("{Enter}") WinWaitActive("Citrix ICA Web Client") Send("{Enter}") Link to comment Share on other sites More sharing options...
PC.Guru.01 Posted September 19, 2007 Author Share Posted September 19, 2007 RunAsSet() will not login nor check the credentials if they are correct.You need to use RunWait() to validate that.JosSo, are you trying to tell me I can't use the RunAsSet within an If statement? I just want to try login with one or the other, that is it. the rest of my script work perfect, just got to get past this password issue. Link to comment Share on other sites More sharing options...
weaponx Posted September 19, 2007 Share Posted September 19, 2007 (edited) Your If statement is fine, but you should be checking for @error in that second RunAsSet() Edited September 19, 2007 by weaponx Link to comment Share on other sites More sharing options...
Developers Jos Posted September 19, 2007 Developers Share Posted September 19, 2007 So, are you trying to tell me I can't use the RunAsSet within an If statement? I just want to try login with one or the other, that is it. the rest of my script work perfect, just got to get past this password issue. Nope , what I am telling you is that you need to do a RunWait() to test if the password is valid. Example: ;Login to Local Administrator Account but if it fails on the 1st password(OLD Win2K Password), it will try the 2nd password (NEW XP Password) Opt("RunErrorsFatal", 0) ;1=fatal, 0=silent set @error RunAsSet("localadmin",@ComputerName,"Win2KPass") $RC = RunWait(@ComSpec & " /c dir qq " , @Tempdir, @SW_HIDE) If @error Then MsgBox(0,"First wrong","First wrong") RunAsSet("localadmin",@ComputerName,"XPPass") $RC = RunWait(@ComSpec & " /c dir qq " , @Tempdir, @SW_HIDE) If @error Then MsgBox(0,"both wrong","both wrong") Exit EndIf EndIf SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PC.Guru.01 Posted September 19, 2007 Author Share Posted September 19, 2007 JdeB That was the magically missing code! You are awesome... Thanks so much for your assistance! 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