Open In App

ASP VolumeName Property

The ASP VolumeName Property is used for setting or returning the volume name of the specified drive. 

Syntax:



DriveObject.VolumeName[=newname]

Parameters: This property has a single parameter as mentioned above and described below:

Example: The below code demonstrates the ASP Drive.VolumeName Property.






<%
dim fs,d1,d2
set fs=Server.CreateObject("Scripting.FileSystemObject")
  
'Getting the drive
set d1=fs.GetDrive("D:")
  
'Getting the name of the drive
Response.Write("The volume name is: " & d1.VolumeName)
  
'Getting the drive
set d2=fs.GetDrive("F:")
  
'Getting the name of the drive
Response.Write("<br>The volume name is: " & d2.VolumeName)
  
set d1=nothing
set d2=nothing
set fs=nothing
%>

Output:

The volume name is: Windows
The volume name is: Software
Article Tags :