AramisResearch Posted July 21, 2006 Share Posted July 21, 2006 I have this chunk of VBS code: ' --------------------------------------------------------------------------------------- ' | Disable AutoLogon | ' --------------------------------------------------------------------------------------- Function DisableAutoLogon() On Error Resume Next Err.Clear FSO.DeleteFile "M:\ccs\udf.ini", True If( (WshShell.RegWrite("HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", "", "REG_SZ") <> 0) Or (WshShell.RegWrite("HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", "", "REG_SZ") <> 0) Or (WshShell.RegWrite("HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword", "", "REG_SZ") <> 0) Or (WshShell.RegWrite("HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "0", "REG_SZ") <> 0) Or (WshShell.RegWrite("HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword", "", "REG_SZ") <> 0) ) Then WshShell.LogEvent 1, "Disable AutoLogon FAIL" Else WshShell.LogEvent 0, "Disable AutoLogon Successful" End If End Function Notice the If ((WhsShell.RegWrite... part. Can I string RegWrite's together like this in an If - Then statement in AutoIT? Also, in VBS I can hang a _ character off the end of the line and that signals the continuation of the code on the next line. Is there an equivalent in AutoIT? Thanks, -Chris Link to comment Share on other sites More sharing options...
MHz Posted July 21, 2006 Share Posted July 21, 2006 (edited) AutoIt has it's own builtin Reg* functions for ease of use and yes you can combine them into a long conditional line, just as displayed. Edit: Underscore is valid in AutoIt also, just leave a space before the previous character and the underscore will work fine. Edit2: Underscore as in continuation character I am refering to... Edited July 21, 2006 by MHz 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