Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'==========================================
'VBScript: enableAutoLogon.vbs =
'This VBScript updates the registry to =
'enable auto-logon. Modify the three =
'strings in brackets, under "Define =
'keys and values". =
'Courtest of Jonathan Almquist =
'monsterjta @ tek-tips =
'==========================================
Option Explicit
''''''''''''''
'Declarations'
''''''''''''''
Dim objShell
Dim RegLocAutoLogon
Dim keyDefaultDomainName
Dim valDefaultDomainName
Dim keyDefaultUserName
Dim valDefaultUserName
Dim keyDisableCAD
Dim valDisableCAD
Dim keyAutoAdminLogon
Dim valAutoAdminLogon
Dim keyForceAutoLogon
Dim valForceAutoLogon
Dim keyDefaultPassword
Dim valDefaultPassword
''''''''''''''''''''''''
'Define keys and values'
''''''''''''''''''''''''
RegLocAutoLogon = "HKLM\Software\Microsoft\" & _
"Windows NT\CurrentVersion\Winlogon\"
keyDefaultDomainName = "DefaultDomainName"
valDefaultDomainName = "[your domain name here]"
keyDefaultUserName = "DefaultUserName"
valDefaultUserName = "[your default user name here]"
keyDisableCAD = "DisableCAD"
valDisableCAD = 1
keyAutoAdminLogon = "AutoAdminLogon"
valAutoAdminLogon = "1"
keyForceAutoLogon = "ForceAutoLogon"
valForceAutoLogon = "1"
keyDefaultPassword = "DefaultPassword"
valDefaultPassword = "[your password here]"
Set objShell = CreateObject("WScript.Shell")
objShell.RegWrite RegLocAutoLogon & _
keyDefaultDomainName, 1, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyDefaultDomainName, valDefaultDomainName, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyDefaultUserName, 1, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyDefaultUserName, valDefaultUserName, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyDisableCAD, 1, "REG_DWORD"
objShell.RegWrite RegLocAutoLogon & _
keyDisableCAD, valDisableCAD, "REG_DWORD"
objShell.RegWrite RegLocAutoLogon & _
keyAutoAdminLogon, 1, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyAutoAdminLogon, valAutoAdminLogon, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyForceAutoLogon, 1, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyForceAutoLogon, valForceAutoLogon, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyDefaultPassword, 1, "REG_SZ"
objShell.RegWrite RegLocAutoLogon & _
keyDefaultPassword, valDefaultPassword, "REG_SZ"
'==========================================================================
'
' NAME: AutoLoginConfig.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.TheSpidersParlor.com[/URL]
' COPYRIGHT (c) 2005 All Rights Reserved
' DATE : 2/18/2006
'
' COMMENT: Configures AutoLogin and allows screen lock.
' USAGE: Login as the ID to be set for auto login and execute this script.
'
'==========================================================================
on error resume next
Dim WshNetwork, strDomainName, path
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WSHShell = Wscript.CreateObject("WScript.Shell")
path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
strDomainName = WshNetwork.UserDomain
strUserName = WshNetwork.UserName
AdminPassword = InputBox("Enter Admin Password","Password?")
WSHShell.RegWrite path & "AutoAdminLogon","1","REG_DWORD"
WSHShell.RegWrite path & "DefaultUserName",strUsername,"REG_SZ"
WSHShell.RegWrite path & "DefaultDomainName",strDomain,"REG_SZ"
WSHShell.RegWrite path & "DefaultPassword",AdminPassword,"REG_SZ"
If Msgbox("Do you wish to lock the screen after startup?", vbYesNo, "Security Risk!") = vbYes Then
Set fso = CreateObject("Scripting.FileSystemObject")
strStartup = WSHShell.SpecialFolders("Startup")
Set ts = fso.CreateTextFile(strStartup & "\lock.txt", ForWriting)
ScriptCode = "Set WSHShell = Wscript.CreateObject("& Chr(34) & "WScript.Shell" & Chr(34) & ")" & vbCrLf
ScriptCode = ScriptCode & "WSHShell.Run("& Chr(34) & "rundll32.exe user32.dll, LockWorkstation" & Chr(34) & ")"
ts.write ScriptCode
ts.close
WScript.Sleep 1000
fso.MoveFile (strStartup & "\lock.txt"),(strStartup & "\lock.vbs")
End If
If err then
msgbox "Error Encountered"
Else
msgbox "Auto Login Configured Successfully"
End if
One question...Will the below lines set the auto login user to be local admin?
keyAutoAdminLogon = "AutoAdminLogon"
valAutoAdminLogon = "1"