# Last update: 2026-09-26T18:01:35Z UTC Clear-Host Write-Host -ForegroundColor Darkgray "localonly.win" Write-Host "* Press CTRL+C or ALT+F4 to abort" Write-Host "* Windows will ask to change the default (empty) password before first login" Write-Host "* User name can't contain these characters: / \ [ ] : | < > + = ; , ? * % `"`n" :l while ($true){ $UserName = Read-Host "Who's going to use this PC ? (leave empty to use 'Admin') " if ( ($UserName -notmatch '\/|\\|\[|\]|\:|\||\<|\>|\+|\=|\;|\,|\?|\*|\%|"') ` -and ($UserName -notmatch "^\s+$") ) { break l } } if ([string]::IsNullOrEmpty($UserName)){ $UserName = "Admin" } Write-Host "Creating user `"$UserName`"" $XLMURL = "https://localonly.win/unattend.xml" $XMLPath = "$env:windir\Panther\unattend.xml" try { Invoke-WebRequest -Uri "$XLMURL" -OutFile "$XMLPath" } catch { Write-Host -ForegroundColor Red "ERROR: cannot get $XLMURL. Aborting" exit 1 } try { (Get-Content "$XMLPath").Replace('@USERNAME@', "$UserName") | Set-Content "$XMLPath" } catch { Write-Host -ForegroundColor Red "ERROR: cannot edit `"$XMLPath`". Aborting" Remove-Item -Path "$XMLPath" -Force exit 1 } Write-Host "Machine is going to reboot. Please wait..." Start-Process -FilePath "$env:windir\System32\Sysprep\Sysprep.exe" -ArgumentList "/oobe /unattend:$XMLPath /reboot"