Showing posts with label Drives. Show all posts
Showing posts with label Drives. Show all posts

Tuesday, February 7, 2017

VBScript List And Details Of Local Drives

set FSO = CreateObject("Scripting.FileSystemObject")

'Display all drives and their properties
set ds = FSO.Drives
WScript.Echo "List of drives:"
for each d in ds
    WScript.Echo ""
    WScript.Echo "Drive Letter = " & d.DriveLetter
    WScript.Echo "Type = " & d.DriveType
    WScript.Echo "Ready = " & d.IsReady
    WScript.Echo "Path = " & d.Path
    WScript.Echo "Share Name = " & d.ShareName
    if d.IsReady then
        Details = "File System = " & d.FileSystem _
            & ", Serial = " & d.SerialNumber _
            & ", Volume = " & d.VolumeName _
            & ", Size = " & d.TotalSize _
            & ", Free = " & d.FreeSpace
        WScript.Echo Details
    end if
next