Core code:
Function Showdrivetype (Drvpath) Dim fso, D, t Set FSO = CreateObject ("Scripting.filesystemobje CT ") Set d = fso. Getdrive (FSO. GetDriveName (Drvpath)) Select case d.drivetype case 0 t = "Unknown" Case 1 t = "removable" ' Mobile hard disk case 2 T = ' F Ixed "' HDD case 3 t =" Network "' Network hard case 4 T =" CD-ROM "case 5 t =" RAM Disk "' Ram end Select Showdri
Vetype = "Drive" & D.driveletter & ":-" & T End Function function Showfreespace (drvpath) Dim FSO, D, S Set fso = CreateObject ("Scripting.FileSystemObject") Set D = fso. Getdrive (FSO. GetDriveName (Drvpath)) ' d is f:s = "Drive" & UCase (Drvpath) & "-" s = S & d.volumename & "" s = S & "Free Spaces:" & FormatNumber (d.freespace/1024, 0) s = S & "Kbytes" Showfreespace = S End Function Dim Message message = Showdrivetype ("F:\Programming\Applications") MsgBox Message message = Showfreespace ("F:\Programming\ Applications ") MsgBox message