Option Explicit
Dim FsoObject, DiskDrive, AvailSpace
' Instantiate the VBScript FileSystemObject
Set FsoObject = WScript.CreateObject("Scripting.FileSystemObject")
' Use the FilesystemObject Object's GetDrive Method to set up a reference to the computer's
' C: Drive.
Set DiskDrive = FsoObject.GetDrive(FsoObject.GetDriveName("C:"))
' Main Processing Section
' Use the FileSystemObjects FreeSpace Property to Determine the Amount of FreeSpace in MB
' on the C: Drive
AvailSpace = ((DiskDrive.FreeSpace / 1024) / 1024) / 1024
' Use VBScripts FormatNumber Function to format the results as a Whole Number
AvailSpace = FormatNumber(AvailSpace, 0)
' Display the Amount of Free Space on the C: Drive
WScript.Echo "There is Currently: " & AvailSpace & " GB available on the C: Drive"