Jump to content

Is the syntax for AutoIT like like this VBS?


Recommended Posts

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

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.

:D

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 by MHz
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...