Open In App

ASP VolumeName Property

Last Updated : 22 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

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

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads