Skip to content
Related Articles

Related Articles

Improve Article

ASP VolumeName Property

  • Last Updated : 22 Mar, 2021
Geek Week

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:

  • newname: It specifies the new name that has to be set for the drive. It is an optional parameter.

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

ASP




<%
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
My Personal Notes arrow_drop_up
Recommended Articles
Page :