borderAndreaVB free resources for Visual Basic developersborder
AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2017 Andrea Tincani
:: Set the Automatic Windows NT Logon using the Registry

Author  

Andrea Tincani

Language  

VB5, VB6

Operating Systems  

Windows NT
Module

'this tip uses the code shown in the previous tip
Public Sub SetAutomaticNTLogon(User As String, Password As String, Domain As String)
    SetRegValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "1"
    SetRegValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", User
    If Password = "" Then
        DeleteValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword"
    Else
        SetRegValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", Password
    End If
    SetRegValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", Domain
End Sub

:: Navigation

Home

Using the Registry

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 08-09-2005 Re: Customizing Andrea VB by misterxed
borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2017 Andrea Tincaniborder