diff --git a/tools/autologon.cmd b/tools/autologon.cmd new file mode 100644 index 0000000..a39d276 --- /dev/null +++ b/tools/autologon.cmd @@ -0,0 +1,10 @@ +@echo off +set TOOLS=c:\tools + +echo ####### %0 ####### + +echo Activating Auto Logon for a user ... +powershell -command %TOOLS%\autologon.ps1 + +echo ####### %0 ####### + diff --git a/tools/auto-logon.ps1 b/tools/autologon.ps1 similarity index 87% rename from tools/auto-logon.ps1 rename to tools/autologon.ps1 index 588bcca..38eff5e 100644 --- a/tools/auto-logon.ps1 +++ b/tools/autologon.ps1 @@ -1,10 +1,11 @@ +# Activate Auto-Logon $Username = Read-Host 'USER ? ' $Password = Read-Host 'PASSWORD ? ' $RegistryPath = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Set-ItemProperty $RegistryPath 'AutoAdminLogon' -Value "1" -Type String -Set-ItemProperty $RegistryPath 'DefaultUsername' -Value "$Username" -type String +Set-ItemProperty $RegistryPath 'AutoAdminLogon' -Value "1" -Type String +Set-ItemProperty $RegistryPath 'DefaultUsername' -Value "$Username" -type String Set-ItemProperty $RegistryPath 'DefaultPassword' -Value "$Password" -type String Write-Warning "AUTO LOGON for user [ $Username ] configured!" diff --git a/scripts/disable-autologon.cmd b/tools/disable-autologon.cmd similarity index 68% rename from scripts/disable-autologon.cmd rename to tools/disable-autologon.cmd index 880098a..d539c22 100644 --- a/scripts/disable-autologon.cmd +++ b/tools/disable-autologon.cmd @@ -2,10 +2,12 @@ echo ####### %0 ####### -echo disabling autologon for admin ... +echo disabling autologon ... reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /f 2>nul reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /f 2>nul reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /f 2>nul +reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" ^ + /v "AutoAdminLogon" /t REG_SZ /d 0 /f 2>nul echo ####### %0 #######