Skip navigation

JSI Tip 0867. How do I automatically logon during an unattended setup?.

The following methodology was provided my Martien Truijen, a frequent visitor to this site:

Using standard commands, you can configure an automatic Administrator logon after joining a domain during unattended setup.

Create autolog.cmd in the $oem$ folder:

@echo off
for /f "tokens=1,3 delims= " %%i in (%systemroot%\system32\$winnt$.inf) do if "%%i"=="ComputerName" set domain=%%j
echo "DefaultDomainName"=%domain% >> autolog.reg
regedit /s autolog.reg

Create autolog.reg in the $oem$ folder:


\[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\]

Add the autolog.cmd to the cmdlines.txt:


Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.