Title: Reorder CDROM/DVDROM Drive Letters in Reverse Alpha
Description:
If you reorder your CDROM/DVDROM drives in reverse alphabetical order in your environment, you may have use for this script. If you have one or more "disk drives" on a system, you can run this script and it will reorder them in reverse alphabetical order.
Example:
Description:
If you reorder your CDROM/DVDROM drives in reverse alphabetical order in your environment, you may have use for this script. If you have one or more "disk drives" on a system, you can run this script and it will reorder them in reverse alphabetical order.
Example:
- If you have a single drive on a single system, if you run this script, it will be relablelled as the "Z:" drive.
- If you have multiple drives on a single system (e.g. E:, F:, G:), they will be relabelled as Z:, Y:, X:, respectively.
- Does not account for drives already in use.
- Does not account for the potential of a large number of disk drives that would be greater than 26.
$CDROMs = @(Get-WmiObject Win32_Volume -Filter "DriveType=5") $Alpha = @() 65..90 | % { $Alpha += [char]$_ } for ($x=0; $x -lt $CDROMs.Count; $x++) { $idx = 25 - $x $CDROMs[$x] | Set-WmiInstance -Arguments @{DriveLetter = "$($Alpha[$idx])`:" } }
It works perfectly
ReplyDeleteTHKS
Thierry