RegistyKey - Automatic Logon

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
 
T

Ty Moffett

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
 
S

scorpion53061

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top