Ensure Windows Installs On C: Drive During SCCM OSD Task Sequences

When Windows is installed during an operating system deployment task sequence in SCCM, it is possible that it will end up on a drive letter other than C: like pictured here:

WindowsOnEDrive.png

I’ve seen a few methods to fix this problem, but the solution I’ve found to be the quickest and easiest is to force Windows to re-evaluate all drive letters after the OS image has been applied.  This is done by deleting the MountedDevices key in the System registry hive.

This can be accomplished during a task sequence by adding three custom Run Command Line steps:

AddRunCommandLineTask.PNG

The three commands will load the hive, delete the key, then unload the hive.  It is important these are added AFTER the task that applies the operating system:

deleteregtssteps

The first Run Command Line task will load the System Registry hive, so I name this step Load Registry System Hive CMD.  Utilize Reg.exe to load the System hive (HKLM\System) from the appropriate supporting file to a temporary registry location I will call Temp:

Reg.exe load HKLM\Temp %OSDTargetSystemDrive%\Windows\system32\config\system

loadhiveforc

The second Run Command Line task will delete the MountedDevices Registry key.  I call this step Delete MountedDevices From Registry CMD.  The command to force delete the appropriate key is:

Reg.exe delete HKLM\Temp\MountedDevices /va /f

deletemountforc

It is important that the System hive be unloaded once it is done being modified, so the third and final Run Command Line task will take care of this.  I name this task Unload Registry System Hive CMD.  The command to unload Temp is:

Reg.exe unload HKLM\Temp

unloadhiveforc

Once these three steps are saved to a task sequence, Windows should begin reliably ending up on drive letter C:.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: