@echo off
set TOOLS=c:\tools
set THINUSER=THINCLIENT

echo ####### %0 #######

echo Changing shell to THINCLIENT.EXE ...
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
  /v Shell /t REG_SZ /d "%TOOLS%\thinclient.exe" /f 2>/nul

echo Creating user %THINUSER% ...
net user %THINUSER% /passwordreq:no /passwordchg:no /ADD

echo Setting password expire date of user %THINUSER% to NEVER ...
WMIC USERACCOUNT WHERE Name='%THINUSER%' SET PasswordExpires=FALSE

echo Disabling Lockscreen function ...
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
  /v DisableLockWorkstation /t REG_DWORD /d "1" /f 2>/nul

echo Disabling fast User switching ...
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" ^
  /v HideFastUserSwitching /t REG_DWORD /d "1" /f 2>/nul

echo Activating Auto Logon for user %THINUSER% ...
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
  /v AutoAdminLogon /t REG_SZ /d "1" /f 2>/nul

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
  /v DefaultUsername /t REG_SZ /d "%THINUSER%" /f 2>/nul

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ^
  /v DefaultPassword /t REG_SZ /d "" /f 2>/nul

echo.
echo Please REBOOT NOW.
echo.

echo ####### %0 #######

