cscript /nologo scriptname.vbs
El script es el siguiente:
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
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
No te olvides de seguir las actualizaciones de la página en tu Facebook.
0 comentarios:
Publicar un comentario