After a few trial runs, here is what I did:
Modify the sysprep.inf file (with setupmgr.exe) so that:
1 - Completely Unattended = NO
2 - Additional commands = startup.cmd (Add this command, this will create a CMDLINES.TXT file under \sysprep\i386$oem$
include in [I][B]\sysprep\i386$oem$[/B][/I] as [I][B]startup.cmd[/B][/I]:
[B]cd %SystemDrive%\Drivers\SAD[/B]
[B]call DP_Install_Tool.cmd[/B]
in [I][B]\Drivers\SAD[/B][/I], edit [B][I]DP_Install_Tool.CMD[/I][/B]:
just after these lines:
[B]popd[/B]
[B]endlocal[/B]
include:
[CODE]ECHO @ECHO OFF > %SystemDrive%\Drivers\RemoveD.cmd
ECHO reg add HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v CMD0 /t REG_SZ /d “rd /s /q %SystemDrive%\Drivers” >> %SystemDrive%\Drivers\RemoveD.cmd
ECHO rd /s/q %SystemDrive%\D >> %SystemDrive%\Drivers\RemoveD.cmd
ECHO DEL /F /S /Q /A “%SystemDrive%\Drivers\SAD” >> %SystemDrive%\Drivers\RemoveD.cmd
ECHO rd /s/q %SystemDrive%\Drivers\SAD >> %SystemDrive%\Drivers\RemoveD.cmd
ECHO EXIT >> %SystemDrive%\Drivers\RemoveD.cmd
shutdown -r -c “Drivers Installed! Machine will now restart…”
call C:\Drivers\RemoveD.cmd
NET START “Fog Service”
[/CODE]
The RunOnce key added will delete the \Drivers\SAD directory on next reboot, since RemoveD.cmd can’t do it after erasing itself. But since the FOG service is restarted just after RemoveD.cmd, the FOG service will restart the computer (to rename it).
Tried many times and works like a charm!
Hope it helps!