Last active
December 28, 2021 16:37
-
-
Save Jawabiscuit/f0b3952f558470c2034bb70e40933e29 to your computer and use it in GitHub Desktop.
Change drive letters on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change drive letters and labels on Windows using powershell | |
# On a new install, Windows maps drives somewhat randomly | |
# Details: https://devblogs.microsoft.com/powershell-community/changing-drive-letters-and-labels-via-powershell/ | |
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'D:'" | |
$Drive | Set-CimInstance -Property @{DriveLetter='M:'; Label='Media'} | |
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'E:'" | |
$Drive | Set-CimInstance -Property @{DriveLetter='S:'; Label='Storage'} | |
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'H:'" | |
$Drive | Set-CimInstance -Property @{DriveLetter='D:'; Label='Data'} | |
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'D:'" | |
$Drive | Set-CimInstance -Property @{DriveLetter='S:'; Label='Storage'} | |
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'F:'" | |
$Drive | Set-CimInstance -Property @{DriveLetter='W:'; Label='Windows'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment