Today, Mick Genie has come out same sample script to calculate theĀ free space from particular disk drive.
Below is the sample script as you may use the following script and save it to file.vbs.
Set DiskSpace = GetObject(“winmgmts:{impersonationLevel=impersonate}”).ExecQuery (“select * from Win32_LogicalDisk where DriveType=3″)
Dim Result
For each Disk in DiskSpace
If (Disk.Name=”D:”) Then
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Result = Disk.Name + ” ” + Disk.FreeSpace + ” GB”
End If
Next
WScript.Echo Result
With above script, you may change the drive with D: to E: , F: , etc and you will get the information from the drive specifically.