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:
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:
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:
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
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
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
Once these three steps are saved to a task sequence, Windows should begin reliably ending up on drive letter C:.