Ok, a few notes gathered from my own experience:
When doing a NLite image for multiple machines, make sure Setupcomplete.cmd has a way to tell which machine you're installing at a given time. As Kasual sugested, this could be acomplished by getting the model name from WMIC or, the Hostname. In case hostname is used, a different AutoUnattend.xml is needed for each machine.
I much prefer to use the Hostname method, since it lets me swap between multiple versions of an install easily. It's also possible to combine both, for cases where one machine is an ancient Pentium Dual Core 1.6GHz whose screwed up bios has no identifiers other than 'AMI'.
This is the way I do it:
Code:
For /F "tokens=2 delims==" %%a in ('wmic computersystem get model /value') do set model=%%a
For /F %%a in ('hostname') do set pcname=%%a
goto %model%
goto %pcname%
goto error
This way, if it fails to find a Model Name, it'll look for a Hostname, and only trully return an error if none is found. In case of multiple machines of the same model (or some screwed Gigabyte BIOS whose Model is just 'Gigabyte'), I do a section like this:
Code:
:Model Name
start wait %WINDIR%\Setup\Files\Program1.exe /switch1 /switch2
start wait %WINDIR%\Setup\Files\Program2.exe /switch1 /switch2
goto %pcname%
:Hostname1
start wait %WINDIR%\Setup\Files\Program3a.exe /switch1 /switch2
goto common
:Hostname2
start wait %WINDIR%\Setup\Files\Program3b.exe /switch1 /switch2
goto common
It is useful when some program or another happens to require one serial number for each machine, or when one of those has a driver or device the other doesn't.
I won't claim my method is perfect, but it does work against 7 different PCs (Ok, maybe 6 and a
undead zombie notebook, but one more will arriving next week and it will be included) from various family members. It also avoids bloating the installation media or having to redo it anytime a program or driver updates, since those would also be included on SetupComplete Scripts.
Now for some more switches!
Code:
::Intel Graphics Driver (Tested on 3rd, 4th, 6th and 7th gen drivers, doesn't work on unsigned drivers)
%WINDIR%\Setup\Files\Intel7th\igxpin.EXE -overwrite -s
::Geforce Drivers (Make sure to lite the thing first! Also, 3XX and 9XX drivers are different!)
%WINDIR%\Setup\Files\Geforce\Setup.EXE /clean /noreboot /passive /noeula /nofinish
::Notepad++ and Notepad Replacer (Updater and autocompletion plugins removed, because they always update when I'm in a hurry!)
%WINDIR%\Setup\Files\Notepad.exe /S
rd /q /s "%ProgramFiles%\Notepad++\updater"
rd /q /s "%ProgramFiles%\Notepad++\autoCompletion"
%WINDIR%\Setup\Files\Replacer.exe /NOTEPAD="C:\Program Files\Notepad++\Notepad++.exe" /SILENT
::Microsoft Office Non-Click to Run
%WINDIR%\Setup\Files\Office\Setup.exe /adminfile Lite.msp ::<<You'll have to run Setup.exe /admin first to created said file. That said, there's a lot of customizations possible in there.
rd /q /s "%SYSTEMDRIVE%\MSOCache" :: To Delete the trash left by the install
Oh, and as a last note: Some drivers dislike being ntlited into the windows image. Intel Thermal Framework for instance, breaks anything related to other sensors (Why it'd break accelerometer drivers?! Why?!) when that is done. So the setupcomplete method is preferable.