Automatically Log On After Booting

Leave a comment

July 27, 2011 by Rakesh Boraiah


Script to turn on automatic logon

‘ Script to turn on automatic logon
‘ (c) Wipro Infotech 2011
‘ Rakesh Boraiah…!
Dim Prompt, oWSH,UserName, UserPass, UserDomain
set oWSH = WScript.CreateObject(“WScript.Shell”)

Prompt = “Enter the autologon user name”
UserName = InputBox(Prompt, Title, “”)

Prompt = “Enter the autologon user password for ” & UserName
UserPass = InputBox(Prompt, Title, “”)

Prompt = “Enter the autologon user domain for ” & UserName
Userdomain = InputBox(Prompt, Title, “”)

oWSH.RegWrite “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon”,”1″,”REG_SZ”
oWSH.RegWrite “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName”, UserDomain, “REG_SZ”
oWSH.RegWrite “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName”, UserName, “REG_SZ”
oWSH.RegWrite “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword”, UserPass, “REG_SZ”
oWSH.RegWrite “HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon\ForceAutoLogon”, “1”, “REG_SZ”

Legend = “AutoLogon has been Configured – have a nice day!”
MyBox = MsgBox (legend, 4096, “We’re Done”)

Script to remove automatic logon

‘ Script to remove automatic logon
‘ (c) Wipro Infotech 2011
‘ Rakesh Boraiah…!
Option Explicit
On Error Resume Next
Dim Prompt, oWSH
set oWSH = WScript.CreateObject(“WScript.Shell”)
oWSH.RegDelete “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon”
oWSH.RegDelete “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName”
oWSH.RegDelete “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName”
oWSH.RegDelete “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword”
Legend = “AutoLogon has been removed – have a nice day!”
MyBox = MsgBox (legend, 4096, “We’re Done”)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: