VolumeName Property

 

Description

 

Sets or returns the volume name of the specified drive. Read/write.

 

PowerBASIC Syntax

 

PROPERTY GET VolumeName () AS STRING

PROPERTY SET VolumeName(BYVAL bstrName AS STRING)

 

Arguments

 

bstrName

BSTR. The volume name.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM pDrive AS IDrive

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get a reference to the IDrive interface

pDrive = fso.GetDrive(UCODE$("A:"))

' If the disk is ready

IF pDrive.IsReady THEN

  ' Change the volume name

  pDrive.VolumeName = UCODE$("Test")

  ' Retrieve the volume name

  STDOUT "Volume name: " & pDrive.VolumeName

END IF

 

Valid XHTML 1.0 Transitional