REM 1) Check if we are running elevated (admin) net session >nul 2>&1 if %errorlevel% neq 0 ( echo Requesting elevation... powershell -NoProfile -ExecutionPolicy Bypass ^ -Command "Start-Process -FilePath '%~f0' -Verb RunAs" goto :EOF ) "C:\Program Files\PowerShell\7\pwsh.exe" -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Sysinternals\sfld_autologon.ps1" REM 2) Clear any leftover imaging AutoLogonCount. Imaging tops it up for REM SupportUser and Autologon leaves it in place, so ShopFloor autologon REM would switch itself off again when it counts down to 0. reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /f /reg:64 >nul 2>&1