Change CDROM Drive Letter using Powershell during OSD

Benoit LecoursPowershell, SCCM5 Comments

SmsSwDistCacheDirDelete in ccmsetup.log 03

By default, Windows will assign the next available letter to your CD/DVD ROM drive. For servers and even workstation it could be useful to change it to a standard value.

Add a Run command Line step in the end of your task sequence that run a powershell command.

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -command “(gwmi Win32_cdromdrive).drive | %{$a = mountvol $_ /l;mountvol $_ /d;$a = $a.Trim();mountvol z: $a}”

You change the last Z: to another letter to fit your environment.

5 Comments on “Change CDROM Drive Letter using Powershell during OSD”

  1. Hello,I log on to your new stuff named “Change CDROM Drive Letter using Powershell during OSD” daily.Your writing style is awesome, keep doing what you’re doing! And you can look our website about free proxy.

  2. Got multiple CD drives? Then try this:
    %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -command “$z=90; (gwmi Win32_cdromdrive).drive | %{$a=mountvol $_ /l; mountvol $_ /d; $a=$a.Trim(); $l=[char]$z+\”:\”; mountvol $l $a; $z=$z-1}”

Leave a Reply

Your email address will not be published. Required fields are marked *