Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell and WMI to Change Disk Label

$
0
0

Summary: Learn how to use Windows PowerShell and WMI to change a disk label.

Hey, Scripting Guy! Question How can I use Windows PowerShell with WMI to change the disk label on a logical disk?

Hey, Scripting Guy! Answer Beginning with Windows PowerShell 3.0, use the Get-CimInstance cmdlet to retrieve
          the logical disk, and then use the Set-CimInstance cmdlet to set the VolumeName:

Get-CimInstance win32_logicaldisk -Filter "deviceID = 'c:'" |

Set-CimInstance -Property @{volumename = 'SSD'}

Note  This technique requires you to start the Windows PowerShell console with elevated rights.


Viewing all articles
Browse latest Browse all 3333

Trending Articles