RegistyKey - Automatic Logon

  • Thread starter Thread starter Ty Moffett
  • Start date Start date
T

Ty Moffett

Below is a function that I would like to add 3 values to the registry in order to have Windows 2000/XP to logon automatically. The three values are DefaultUserName, AutoAdminLogon, and DefaultPassword and should be added in this location: HKLM\Software\Microsoft\Windows NT\Current Version\Winlogon. The DefaultUserName already exists but the other 2 need to be created.

After running my code the 3 values are not created or changed. I can't figure it out. Can anyone offer some advice?

Imports Microsoft.Win32

Module HandsOff
Public Sub main()
AutoLogon()
End Sub
Public Sub AutoLogon()
Dim rk As RegistryKey = Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows NT\Current Version\Winlogon")
rk.SetValue("DefaultUserName", "Administrator")
rk.SetValue("AutoAdminLogon", "1")
rk.SetValue("DefaultPassword", "solarcit")
End Sub
End Module
 
Bleh, one little space messed it all up. "Current Version" should be "CurrentVersion".
For anyone who is interested, this code works you just need to reset the values/delete the keys when you are done.
Below is a function that I would like to add 3 values to the registry in order to have Windows 2000/XP to logon automatically. The three values are DefaultUserName, AutoAdminLogon, and DefaultPassword and should be added in this location: HKLM\Software\Microsoft\Windows NT\Current Version\Winlogon. The DefaultUserName already exists but the other 2 need to be created.

After running my code the 3 values are not created or changed. I can't figure it out. Can anyone offer some advice?

Imports Microsoft.Win32

Module HandsOff
Public Sub main()
AutoLogon()
End Sub
Public Sub AutoLogon()
Dim rk As RegistryKey = Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows NT\Current Version\Winlogon")
rk.SetValue("DefaultUserName", "Administrator")
rk.SetValue("AutoAdminLogon", "1")
rk.SetValue("DefaultPassword", "solarcit")
End Sub
End Module
 
scary stuff.........

Bleh, one little space messed it all up. "Current Version" should be
"CurrentVersion".
For anyone who is interested, this code works you just need to reset the
values/delete the keys when you are done.
Below is a function that I would like to add 3 values to the registry in
order to have Windows 2000/XP to logon automatically. The three values are
DefaultUserName, AutoAdminLogon, and DefaultPassword and should be added in
this location: HKLM\Software\Microsoft\Windows NT\Current Version\Winlogon.
The DefaultUserName already exists but the other 2 need to be created.

After running my code the 3 values are not created or changed. I can't
figure it out. Can anyone offer some advice?

Imports Microsoft.Win32

Module HandsOff
Public Sub main()
AutoLogon()
End Sub
Public Sub AutoLogon()
Dim rk As RegistryKey =
Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows NT\Current
Version\Winlogon")
rk.SetValue("DefaultUserName", "Administrator")
rk.SetValue("AutoAdminLogon", "1")
rk.SetValue("DefaultPassword", "solarcit")
End Sub
End Module
 
Back
Top