Save this Script as .vbs
Then from command line
cscript /nologo scriptname.vbs
Save this Script as .vbs
Then from command line
cscript /nologo scriptname.vbs
strComputer = "." Set objWMIService = GetObject _ ( "winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_Volume Where DriveType = 3" ) For Each objItem In colItems iSpc = cDbl(objItem.FreeSpace) ispc1 = cDbl(objItem.Capacity) WScript.Echo objItem.Label, "Drive", "has", FormatiSpc(iSpc) & "GB Free OF Volume size: " & FormatiSpc(iSpc1) & "GB" Next Function FormatiSpc(intSpace) intSpace = intSpace/1024 intSpace = intSpace/1024 intSpace = intSpace/1024 intSpace= FormatNumber(intSpace,1) FormatiSpc = intSpace end Function