DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 27 Jun 2007 22:52:43 -0700,    posted on: microsoft.public.dotnet.framework.wmi        back       

Thread Index
  1    Computer Guru
          2    Jonathan Liu [MSFT]


Get disk and partition numbers for drive letter via WMI   
If I query WMI for mounted drives of type 3 (physical hard drives)
and
end up with a letter (like D:), how can I use WMI to get the correct
corresponding partition and drive values for drive D:\ ?

Is it possible to even get the entire ARC path from there?
AS in, multi(w)disk(x)rdisk(y)partition(z)


That would be nice, but I'm willing to settle for just rdisk() and
partition() (basically the drive number and the partition number)


Thanks!
Date:Wed, 27 Jun 2007 22:52:43 -0700   Author:  

Re: Get disk and partition numbers for drive letter via WMI   
Once you get you physical drive you get it's associating partitions, which 
will look like something like this if you have 2 partitions:

WQL Query: associators of {Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE0"}

Win32_DiskPartition.DeviceID="Disk #0, Partition #0"
Win32_DiskPartition.DeviceID="Disk #0, Partition #1"

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at 
http://www.microsoft.com/info/cpyright.htm
--
"Computer Guru"  wrote in message 
news:1183009963.364384.100220@n60g2000hse.googlegroups.com...

> If I query WMI for mounted drives of type 3 (physical hard drives)
> and
> end up with a letter (like D:), how can I use WMI to get the correct
> corresponding partition and drive values for drive D:\ ?
>
> Is it possible to even get the entire ARC path from there?
> AS in, multi(w)disk(x)rdisk(y)partition(z)
>
>
> That would be nice, but I'm willing to settle for just rdisk() and
> partition() (basically the drive number and the partition number)
>
>
> Thanks!
> 
Date:Tue, 7 Aug 2007 14:14:14 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us