Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » Adsi

List Disk Partition Properties in Windows

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.

List Disk Partition Properties in Windows using VBScript, WMI and LDAP

Example(s)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colDiskPartitions = objWMIService.ExecQuery _
    ("Select * from Win32_DiskPartition")

For each objPartition in colDiskPartitions
    Wscript.Echo "Block Size: " & objPartition.BlockSize     
    Wscript.Echo "Bootable: " & objPartition.Bootable 
    Wscript.Echo "Boot Partition: " & objPartition.BootPartition
    Wscript.Echo "Description: " & objPartition.Description
    Wscript.Echo "Device ID: " & objPartition.DeviceID       
    Wscript.Echo "Disk Index: " & objPartition.DiskIndex     
    Wscript.Echo "Index: " & objPartition.Index       
    Wscript.Echo "Name: " & objPartition.Name 
    Wscript.Echo "Number Of Blocks: " & _
        objPartition.NumberOfBlocks     
    Wscript.Echo "Primary Partition: " & _
        objPartition.PrimaryPartition   
    Wscript.Echo "Size: " & objPartition.Size 
    Wscript.Echo "Starting Offset: " & _
        objPartition.StartingOffset     
    Wscript.Echo "Type: " & objPartition.Type 
Next