-1

I have a sysprep file I use and after that I was informed that it runs SetupComplete.cmd,

Basically I want to enable the Administrator account and create auto login for it... Would the following work:

If I add these to "SetupComplete.cmd"

Would they work???

net user administrator /ACTIVE:YES

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d Administrator

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d XXXPASSWORDXXX

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /t REG_DWORD /d 0
2
  • Have you tried it? Disable the account, then run the file, if it becomes enabled then it works. The first command requires Administrator permissions....
    – Ramhound
    Commented Mar 3, 2016 at 22:02
  • Going to try it now, I added added /f to the end of the registry files.
    – Simpuhl
    Commented Mar 3, 2016 at 22:21

2 Answers 2

0

I ended up creating a separate reg file for the auto login part.

SetupComplete.cmd:

:Enable Admin Account
net user Administrator /ACTIVE:YES

:Enable Auto Login
regedit /s %SystemDrive%\AutoLogin.reg

:Cleanup
del /F /Q %SystemDrive%\Unattended.xml
del /F /Q %SystemDrive%\AutoLogin.reg
del /F /Q %SystemRoot%\setup\scripts\SetupComplete.cmd

AutoLogin.Reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AutoAdminLogon"="1"
"DefaultUserName"="Administrator"
"DefaultPassword"="PASSWORD"
0

Just a (hours later) heads-up on SetupComplete.cmd :

net user administrator /ACTIVE:YES

will only work in SetupComplete.cmd if a Product Key has been inserted during the oobe.

If you skip the Product Key form, "net user administrator /ACTIVE:YES" will not run. Not sure of SetupComplete.cmd doesn't run, or just the "net user administrator /ACTIVE:YES" line doesn't run. I only had the one line in the cmd and no more time to experiment.

HTH

Regards . . .

P.S. Nice reg and custom cmd file. Good for the "tool box". Thanks :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .