@avaryan WOW that was quick… Did you just make this!
So, I have a firstboot.bat that runs on the first autologin that does some stuff like delete the unattend.xml, start the fog service, etc.
I think I am just going to have my firstboot.bat file throw another .bat (secondboot.bat) into the startup folder for the administrator account. Who knows maybe we will find something we can add to the secondboot.bat that is useful.
Below is the list of the basic things we do excludes any extra stuff we are doing. Just want to list out how we are doing things in case anyone else wants a super basic process.
*Note: This is the code we use if “CopyProfile” in the unattend.xml is set to false and we are using the DefProf tool.
#win_10-generalize.bat
sc config "FOGService" start= disabled
net stop "FOGService"
cd C:\Tools\firstboot
copy firstboot-shortcut.lnk "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
#more stuff goes on here
cd C:\Windows\System32\Sysprep
sysprep /generalize /oobe /shutdown /unattend:c:\Windows\System32\Sysprep\unattend.xml
Upload to FOG server… Then send out to what ever.
#firstboot.bat
del C:\Windows\System32\Sysprep\*.xml
sc config "FOGService" start= auto
net start "FOGService"
#more stuff goes on here
cd C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
del firstboot-shortcut.lnk
cd C:\Tools\secondboot
copy secondboot-Shortcut.lnk "C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Startup"
del C:\Tools\firstboot\*.bat
#at this point FOG reboots and joins the computer to the domain
# fix my auto log in twice problem
shutdown -r -t 60
cd C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
del secondboot-shortcut.lnk
del C:\Tools\secondboot\*.bat
Probably not the best way to fix this whole logging into the administrator account twice for no reason problem… But it is a quick way to fix it lol.