Optimize-Offline - SetupComplete.cmd - Post-Install (old method)
If you want to integrate your own scripts or programs with Optimize-Offline's SetupComplete.cmd, follow this:
1. Edit the Optimize-Offline.ps1 file using Notepad++
- search for the line:
If (Test-Path -Path "$AdditionalPath\Setup\*
inside the .ps1 file: - replace this whole function:
with this new one:
(Open .gif animation in a new browser tab to enlarge)
- save the changes in the Optimize-Offline.ps1 file.
2. Place your scripts and files in the Optimize-Offline's "Additional" directory:
- go to your Optimize-Offline's
\Resources\Additional\
directory and remove the defaultSetup
folder from there, replace it with my own Setup folder with proper structure designed for the updated function above. - edit the SetupComplete.cmd script from within it using Notepad++ - as you can see i've added some commands there as an example for you, the
REM
is a commented line, if you want to call another .cmd file you have to use thecall
command, i've added the line about KMS_VL_ALL as an example. - remember to always place all your scripts and files in the
\Resources\Additional\Setup\Files
and point to them in the SetupComplete.cmd script at\Resources\Additional\Setup\Scripts
.
The above is just a simplified example of what SetupComplete.cmd scripting is capable of.
More details about SetupComplete.cmd and Post-Install/Unattended scripting in general can be found in this Microsoft's article.
Also, Google is your friend.
Good luck!
This is an old way for the old Optimize-Offline method from here