Editer l'article Suivre ce blog Administration + Créer mon blog

[MDT] How to dynamically install Active Setup in MDT

Publié le par damcuvelier


Download my script ZTIPopulateActiveSetup.wsf

For even more ease/laziness, you should also download the good old CopyOEM.wsf  script from Michael Niehaus (Not Mandatory, an xcopy and a package will lead you to the same goal). The script mimics the $OEM$ folder structure when windows is deployed using setup.exe. With this facility, copying the active setup folder to the target PC will just be a “set it and forget it” action.

To Install both scripts in MDT: put them in the “scripts” folder of your deployment share.

For Config Manager: put them in the “scripts” folder of your MDT package and update the content on you DP.

In the $OEM$ folder of MDT package/deployment share, create the required subfolder structure following this example:  

Subfolders to create are: $1\ProgramData\Active-Setup

The Active-Setup subfolder is where you can stage scripts and registry files that will  then be transformed to active setup registry keys, but there is more: while the $OEM$ structure is copied to the C:\ drive of the target machine, the Active-Setup folder can continue to be filled during the deployment.

Any script that needs to stage new active-setup after the OS is applied just needs to put scripts or registry keys in the C:\ProgramData\Active-Setup folder as the conversion to real active setup is handled at the end of the task sequence.  



Task sequence

Two steps need to be added to a task sequence to make the solution works:

The CopyOEM.wsf scripts should be added right after the Install Operating System step in the install group:

The command to use is cscript.exe "%SCRIPTROOT%\CopyOEM.wsf"

For SCCM, this is nearly the same, the script should be executed in the Post Install Group, right after the Gather step:

This new step makes sure that the pre staged active setup are copied to the destination Hard Drive.


The second step to add will populate the active setup in the registry and should be placed somewhere near the end of the task sequence when no more things  that needs to create active setup will be invoked. If you have no idea, the custom Tasks sub group in the State Restore section should do the job for most of us:

For SCCM, the step can be placed just bellow the Install applications sub group in the State Restore Section

The command to call is cscript.exe "%SCRIPTROOT%\ZTIPopulateActiveSetup.wsf"

Installation is now finished.



User settings

Now that the installation is complete, let’s add some settings for our users. Here are few examples (Copy the content to a text file, then save and rename with the .REG extension) that you could add to your deployment share’s \Active-Setup folder:

Note: In case you still did not get it, please, notice that all registry keys must fall in HKEY_CURRENT_USER hive, Any other context will fail!


Reg file to open Explorer to “This PC” instead of Quick Access

Windows Registry Editor Version 5.00



Reg file to show My PC on desktop

Windows Registry Editor Version 5.00



Reg file to set folder view to detail

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell]


Reg file to use Powershell instead of cmd in the start menu

Windows Registry Editor Version 5.00


This is some basics to get you started, but we can do much more! As I mentioned earlier you can also throw batch files and scripts, here is how to deal with them..


Batches and Scripts

You’ve already seen that the script handle .REG files, what about other format?

The following list present all the supported scripting languages that you can use with your active setups:

  • Batch files with .CMD or .BAT extension.
  • VB script or Java script files with .VBS, .JS or .WSF extension.
  • HTML application files with .HTA extension.
  • Powershell files with .PS1 extension.
  • Application files,with .EXE extension.
  • Direct command line embedded thru a text file with .TXT extension (One command per file)

Note: VB script or Java script are processed using the Cscript.exe interpreter, if for some reasons you need to use Wscript.exe instead, put a capital “W” at the end of your script name.



Once the script has finished working you can see results in the registry at HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components.

The new additions are prefixed with “ZTIMDT-” and look like this:


Commenter cet article