Export (0) Print
Expand All
Expand Minimize

Converting the FileSystemObject's VolumeName Property


Windows PowerShell


Definition: Sets or returns the volume label of a drive.

VolumeName


Retrieve an object reference to the .NET Framework object DriveInfo for the drive you want to work with. You can then use the DriveInfo VolumeLabel property to retrieve the volume label of the drive.


$d = New-Object -typename System.IO.DriveInfo -argumentlist "C:"
$d.VolumeLabel


You can set the volume label with the same property:


$d.VolumeLabel = "My Data Drive"


See conversions of other FileSystemObject methods and properties.
Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft