Sure! its not that complicated, really, its harder to explain than to show really, but it is a bit of a long tutorial.
Just have this as the first line in your script:
This gets the Service Tag of a device (I've tested so far Dell, HP, Acer, but its a standard windows function, so I imagine it works with basically any brand that uses those. This will read that number/string and store it in a variable.
Will redirect you straight to the section corresponding to that Service Tag below, or abort the script in case it doesn't match any. You can also use something like a "Common" section of the script which installs even in the case you plug this OS into a random PC you don't have in your one-script-to-fit-all, and in that case just put the software you want installed like this:
or
Note that the Call function always check further down the script, but not what comes before! So having this kind of script (those are random numbers, but similar to what I see on my Dell Tags):
would have the script running either the first or second tag, depending on the system detected, then running the common section regardless (exit /b means coming back where you left), then self terminating.
Just have this as the first line in your script:
Code:
for /F "tokens=2 delims==" %%a in ('wmic csproduct get identifyingnumber /value') do set tag=%%a
This gets the Service Tag of a device (I've tested so far Dell, HP, Acer, but its a standard windows function, so I imagine it works with basically any brand that uses those. This will read that number/string and store it in a variable.
Code:
call :%tag% 2>nul
exit
Will redirect you straight to the section corresponding to that Service Tag below, or abort the script in case it doesn't match any. You can also use something like a "Common" section of the script which installs even in the case you plug this OS into a random PC you don't have in your one-script-to-fit-all, and in that case just put the software you want installed like this:
Code:
call :%tag% 2>nul
%SYSTEMDRIVE%\Setup\DirectX.exe /y
%SYSTEMDRIVE%\Setup\Runtimes.exe /y
%SYSTEMDRIVE%\Setup\Java64.exe /s REBOOT=Suppress
%SYSTEMDRIVE%\Setup\Java32.exe /s REBOOT=Suppress
msiexec.exe /i %SYSTEMDRIVE%\Setup\FreeOffice.msi /passive /norestart
%SYSTEMDRIVE%\Setup\SumatraPDF.exe -s -install -d "C:\Program Files\SumatraPDF"
%SYSTEMDRIVE%\Setup\7Zip.exe /S
%SYSTEMDRIVE%\Setup\BulkRename.exe /SP- /SILENT /NOCANCEL /NORESTART /SUPPRESSMSGBOXES /ALLUSERS
%SYSTEMDRIVE%\Setup\Notepad.exe /S
rd /q /s "%ProgramFiles%\Notepad++\updater"
rd /q /s "%ProgramFiles%\Notepad++\autoCompletion"
%SYSTEMDRIVE%\Setup\Replacer.exe /NOTEPAD="C:\Program Files\Notepad++\Notepad++.exe" /SILENT
%SYSTEMDRIVE%\Setup\Calculator.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
%SYSTEMDRIVE%\Setup\QImgV.exe /SP- /SILENT /NOCANCEL /NORESTART /SUPPRESSMSGBOXES /LANG=English
%SYSTEMDRIVE%\Setup\Paint.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
%SYSTEMDRIVE%\Setup\VLCSetup.exe /L=1046 /S
%SYSTEMDRIVE%\Setup\BraveSilent.exe
%SYSTEMDRIVE%\Setup\Simplewall.exe /S
%SYSTEMDRIVE%\Setup\ClamWin.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
%SYSTEMDRIVE%\Setup\WinAeroTweaker.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
msiexec.exe /i %SYSTEMDRIVE%\Setup\Transmission.msi /passive /norestart
exit
or
Code:
call :%tag% 2>nul
call: :common 2>nul
exit
Note that the Call function always check further down the script, but not what comes before! So having this kind of script (those are random numbers, but similar to what I see on my Dell Tags):
Code:
for /F "tokens=2 delims==" %%a in ('wmic csproduct get identifyingnumber /value') do set tag=%%a
call :%tag% 2>nul
call: :common 2>nul
exit
:AB1234C
%SYSTEMDRIVE%\Setup\iGPU\igxpin.exe -overwrite -s
%SYSTEMDRIVE%\Setup\Audio-REALTEK.exe /S
%SYSTEMDRIVE%\Setup\Killer-WiFi.exe /S
%SYSTEMDRIVE%\Setup\Killer-Bluetooth.exe /S
%SYSTEMDRIVE%\Setup\Quickset-Touch.exe /S
exit /b
:5678DEF
%SYSTEMDRIVE%\Setup\iGPU\igxpin.exe -overwrite -s
%SYSTEMDRIVE%\Setup\Geforce\Setup.exe /clean /noreboot /passive /noeula /nofinish
%SYSTEMDRIVE%\Setup\Audio-SOUNDMAX\Setup.exe /S
%SYSTEMDRIVE%\Setup\Qualcomm-WiFi-BT.exe /S
%SYSTEMDRIVE%\Setup\Quickset-Non-Touch.exe /S
exit /b
:Common
%SYSTEMDRIVE%\Setup\DirectX.exe /y
%SYSTEMDRIVE%\Setup\Runtimes.exe /y
%SYSTEMDRIVE%\Setup\Java64.exe /s REBOOT=Suppress
%SYSTEMDRIVE%\Setup\Java32.exe /s REBOOT=Suppress
msiexec.exe /i %SYSTEMDRIVE%\Setup\FreeOffice.msi /passive /norestart
%SYSTEMDRIVE%\Setup\SumatraPDF.exe -s -install -d "C:\Program Files\SumatraPDF"
%SYSTEMDRIVE%\Setup\7Zip.exe /S
%SYSTEMDRIVE%\Setup\BulkRename.exe /SP- /SILENT /NOCANCEL /NORESTART /SUPPRESSMSGBOXES /ALLUSERS
%SYSTEMDRIVE%\Setup\Notepad.exe /S
rd /q /s "%ProgramFiles%\Notepad++\updater"
rd /q /s "%ProgramFiles%\Notepad++\autoCompletion"
%SYSTEMDRIVE%\Setup\Replacer.exe /NOTEPAD="C:\Program Files\Notepad++\Notepad++.exe" /SILENT
%SYSTEMDRIVE%\Setup\Calculator.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
%SYSTEMDRIVE%\Setup\QImgV.exe /SP- /SILENT /NOCANCEL /NORESTART /SUPPRESSMSGBOXES /LANG=English
%SYSTEMDRIVE%\Setup\Paint.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
%SYSTEMDRIVE%\Setup\VLCSetup.exe /L=1046 /S
%SYSTEMDRIVE%\Setup\BraveSilent.exe
%SYSTEMDRIVE%\Setup\Simplewall.exe /S
%SYSTEMDRIVE%\Setup\ClamWin.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
%SYSTEMDRIVE%\Setup\WinAeroTweaker.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
msiexec.exe /i %SYSTEMDRIVE%\Setup\Transmission.msi /passive /norestart
exit /b
would have the script running either the first or second tag, depending on the system detected, then running the common section regardless (exit /b means coming back where you left), then self terminating.