The usage of the VBS property DriveType
This article introduces the relevant knowledge of "the use of VBS attribute DriveType". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Returns a value that describes the type of the specified drive.
Object.DriveType
Object should be the name of the Drive object.
Description
The following code illustrates how to use the DriveType property:
Function ShowDriveType (drvpath) Dim fso, d T Set fso = CreateObject ("Scripting.FileSystemObject") Set d = fso.GetDrive (drvpath) Select Case d.DriveType Case 0: t = "unknown" Case 1: t = "removable" Case 2: t = "fixed" Case 3: t = "network" Case 4: t = "CD-ROM" Case 5: t = "RAM disk" End Select ShowDriveType = "drive" This is the end of the introduction of "& d.DriveLetter &":-"& tEnd Function" the usage of the VBS attribute DriveType. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!