473,836 Members | 1,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using WMI to populate Disk Information

Hopefully someone can point me in the right direction. I'm try to construct
a table that has the following information about disk drives on 2000 and NT
4.0 boxes.
Size, Partitions and Logical Drive information. I've figured out most of it,
but here's the problem.
The problem that I'm running into is that we have logical drives that have
no drive letter associated with them. WMI doesn't show logical drives that
have no drive letters. We use Mount points and for empty volume nothing at
all. I know that they change WMI in 2003, but I don't have that luxury. Is
there any way to do this, WMI (I'm missing something)remot e registry? some
third party component. I'm actually trying to show the same information on a
web page that disk manager shows.

Thanks
Steve Gerhart
Nov 15 '05 #1
6 8783
If I do say, there are a number of volume management API functions you could
PInvoke
to get this information. You mention getting mount points, which is possible
using FindFirstVolume MountPoint, volumes using FindFirstVolume . There is a
whole lot of stuff available.
--
Justin Rogers
DigiTec Web Consultants, LLC.

"Steve Gerhart" <Ge******@hotma il.com> wrote in message
news:%2******** *********@TK2MS FTNGP10.phx.gbl ...
Hopefully someone can point me in the right direction. I'm try to construct
a table that has the following information about disk drives on 2000 and NT
4.0 boxes.
Size, Partitions and Logical Drive information. I've figured out most of it,
but here's the problem.
The problem that I'm running into is that we have logical drives that have
no drive letter associated with them. WMI doesn't show logical drives that
have no drive letters. We use Mount points and for empty volume nothing at
all. I know that they change WMI in 2003, but I don't have that luxury. Is
there any way to do this, WMI (I'm missing something)remot e registry? some
third party component. I'm actually trying to show the same information on a
web page that disk manager shows.

Thanks
Steve Gerhart

Nov 15 '05 #2
"Justin Rogers" <Ju****@games4d otnet.com> wrote in message news:<ua******* *******@tk2msft ngp13.phx.gbl>. ..
If I do say, there are a number of volume management API functions you could
PInvoke
to get this information. You mention getting mount points, which is possible
using FindFirstVolume MountPoint, volumes using FindFirstVolume . There is a
whole lot of stuff available.
--
Justin Rogers
DigiTec Web Consultants, LLC.

"Steve Gerhart" <Ge******@hotma il.com> wrote in message
news:%2******** *********@TK2MS FTNGP10.phx.gbl ...
Hopefully someone can point me in the right direction. I'm try to construct
a table that has the following information about disk drives on 2000 and NT
4.0 boxes.
Size, Partitions and Logical Drive information. I've figured out most of it,
but here's the problem.
The problem that I'm running into is that we have logical drives that have
no drive letter associated with them. WMI doesn't show logical drives that
have no drive letters. We use Mount points and for empty volume nothing at
all. I know that they change WMI in 2003, but I don't have that luxury. Is
there any way to do this, WMI (I'm missing something)remot e registry? some
third party component. I'm actually trying to show the same information on a
web page that disk manager shows.

Thanks
Steve Gerhart


You just have to use System.Manageme nt.ManagementOb jectSearcher and
System.Manageme nt.ObjectQuery to make a "SQL-like" query and retrieve
info from

See that http://www.csharphelp.com/archives2/archive334.html and
Win32_LogicalDi sk info on MSDN
Nov 15 '05 #3
Justin,

Thanks for the info. I not very familiar with calling windows APIs,
especially the storage API. Can you lead me to an example?
"Justin Rogers" <Ju****@games4d otnet.com> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
If I do say, there are a number of volume management API functions you could PInvoke
to get this information. You mention getting mount points, which is possible using FindFirstVolume MountPoint, volumes using FindFirstVolume . There is a whole lot of stuff available.
--
Justin Rogers
DigiTec Web Consultants, LLC.

"Steve Gerhart" <Ge******@hotma il.com> wrote in message
news:%2******** *********@TK2MS FTNGP10.phx.gbl ...
Hopefully someone can point me in the right direction. I'm try to construct a table that has the following information about disk drives on 2000 and NT 4.0 boxes.
Size, Partitions and Logical Drive information. I've figured out most of it, but here's the problem.
The problem that I'm running into is that we have logical drives that have no drive letter associated with them. WMI doesn't show logical drives that have no drive letters. We use Mount points and for empty volume nothing at all. I know that they change WMI in 2003, but I don't have that luxury. Is there any way to do this, WMI (I'm missing something)remot e registry? some third party component. I'm actually trying to show the same information on a web page that disk manager shows.

Thanks
Steve Gerhart


Nov 15 '05 #4
"Steve Gerhart" <Ge******@hotma il.com> wrote in message news:<e0******* *******@TK2MSFT NGP10.phx.gbl>. ..
Justin,

Thanks for the info. I not very familiar with calling windows APIs,
especially the storage API. Can you lead me to an example?
Do you know how to retrieve simple info with WMI in c#?
what are your drives without letter (network disk?) ?
"Justin Rogers" <Ju****@games4d otnet.com> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
If I do say, there are a number of volume management API functions you

could
PInvoke
to get this information. You mention getting mount points, which is

possible
using FindFirstVolume MountPoint, volumes using FindFirstVolume . There is

a
whole lot of stuff available.
--
Justin Rogers
DigiTec Web Consultants, LLC.

"Steve Gerhart" <Ge******@hotma il.com> wrote in message
news:%2******** *********@TK2MS FTNGP10.phx.gbl ...
Hopefully someone can point me in the right direction. I'm try to construct a table that has the following information about disk drives on 2000 and NT 4.0 boxes.
Size, Partitions and Logical Drive information. I've figured out most of it, but here's the problem.
The problem that I'm running into is that we have logical drives that have no drive letter associated with them. WMI doesn't show logical drives that have no drive letters. We use Mount points and for empty volume nothing at all. I know that they change WMI in 2003, but I don't have that luxury. Is there any way to do this, WMI (I'm missing something)remot e registry? some third party component. I'm actually trying to show the same information on a web page that disk manager shows.

Thanks
Steve Gerhart


Nov 15 '05 #5
I've written the code to gather all the Physical Disks, the partitions, and
the volumes. The volume part is the hard part, becuase I have volumes on
some of our big files servers that are either mount points or they have no
drive letter associated with them. WMI does not gather volume information
unless there are drive letters assoicated with the volume. I'm hoping there
is a way with WMI, but if it comes down to it, I just call some APIs... The
drives that do not have have a drive letter are not network drives. Thanks
"Cyril Vi?ville" <cy************ @hotmail.com> wrote in message
news:75******** *************** ***@posting.goo gle.com...
"Steve Gerhart" <Ge******@hotma il.com> wrote in message

news:<e0******* *******@TK2MSFT NGP10.phx.gbl>. ..
Justin,

Thanks for the info. I not very familiar with calling windows APIs,
especially the storage API. Can you lead me to an example?


Do you know how to retrieve simple info with WMI in c#?
what are your drives without letter (network disk?) ?
"Justin Rogers" <Ju****@games4d otnet.com> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
If I do say, there are a number of volume management API functions you

could
PInvoke
to get this information. You mention getting mount points, which is

possible
using FindFirstVolume MountPoint, volumes using FindFirstVolume . There
is a
whole lot of stuff available.
--
Justin Rogers
DigiTec Web Consultants, LLC.

"Steve Gerhart" <Ge******@hotma il.com> wrote in message
news:%2******** *********@TK2MS FTNGP10.phx.gbl ...
> Hopefully someone can point me in the right direction. I'm try to

construct
> a table that has the following information about disk drives on 2000
and NT
> 4.0 boxes.
> Size, Partitions and Logical Drive information. I've figured out
most of it,
> but here's the problem.
> The problem that I'm running into is that we have logical drives
that have
> no drive letter associated with them. WMI doesn't show logical
drives that
> have no drive letters. We use Mount points and for empty volume
nothing at
> all. I know that they change WMI in 2003, but I don't have that
luxury. Is
> there any way to do this, WMI (I'm missing something)remot e
registry? some
> third party component. I'm actually trying to show the same
information on a
> web page that disk manager shows.
>
> Thanks
> Steve Gerhart
>
>

Nov 15 '05 #6
"Steve Gerhart" <Ge******@hotma il.com> wrote in message news:<ef******* *******@tk2msft ngp13.phx.gbl>. ..
I've written the code to gather all the Physical Disks, the partitions, and
the volumes. The volume part is the hard part, becuase I have volumes on
some of our big files servers that are either mount points or they have no
drive letter associated with them. WMI does not gather volume information
unless there are drive letters assoicated with the volume. I'm hoping there
is a way with WMI, but if it comes down to it, I just call some APIs... The
drives that do not have have a drive letter are not network drives. Thanks
Weird, isn't there any option coz
DriveType have some values try to make a switch/case mode on that value like
switch (Convert.ToInt3 2(Lecteur["DriveType"]))
{
case 2:
name += "3 1/2 drive";
break;
case 3:
name += Lecteur["VolumeName "].ToString();
break;
case 5:
name += "CD-ROM";
break;
default:
name += Lecteur["Descriptio n"].ToString(); -> Maybe you'll have all others here
break;
}
"Cyril Vi?ville" <cy************ @hotmail.com> wrote in message
news:75******** *************** ***@posting.goo gle.com...
"Steve Gerhart" <Ge******@hotma il.com> wrote in message

news:<e0******* *******@TK2MSFT NGP10.phx.gbl>. ..
Justin,

Thanks for the info. I not very familiar with calling windows APIs,
especially the storage API. Can you lead me to an example?


Do you know how to retrieve simple info with WMI in c#?
what are your drives without letter (network disk?) ?
"Justin Rogers" <Ju****@games4d otnet.com> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
> If I do say, there are a number of volume management API functions you could > PInvoke
> to get this information. You mention getting mount points, which is possible > using FindFirstVolume MountPoint, volumes using FindFirstVolume . There is
a > whole lot of stuff available.
>
>
> --
> Justin Rogers
> DigiTec Web Consultants, LLC.
>
> "Steve Gerhart" <Ge******@hotma il.com> wrote in message
> news:%2******** *********@TK2MS FTNGP10.phx.gbl ...
> > Hopefully someone can point me in the right direction. I'm try to construct > > a table that has the following information about disk drives on 2000 and
NT > > 4.0 boxes.
> > Size, Partitions and Logical Drive information. I've figured out most of
it, > > but here's the problem.
> > The problem that I'm running into is that we have logical drives that
have > > no drive letter associated with them. WMI doesn't show logical drives
that > > have no drive letters. We use Mount points and for empty volume nothing
at > > all. I know that they change WMI in 2003, but I don't have that luxury.
Is > > there any way to do this, WMI (I'm missing something)remot e registry?
some > > third party component. I'm actually trying to show the same information
on a > > web page that disk manager shows.
> >
> > Thanks
> > Steve Gerhart
> >
> >
>
>

Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
6611
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
7
3375
by: clusardi2k | last post by:
Hello, I have a shared drive on SGI, Linux, and Windows. A second call to fopen doesn't create the file if it has been deleted. I would like to use fopen for its pointer return value to solve this. What is the best way to fix this problem?
13
7675
by: Selesti | last post by:
I have written an Access database that our department uses to store and analyze information on particular jobs. Because our company runs on an enormous SQL DB, I thought it would save some time if the basic job details (name, location, salesperson, etc) which is already stored in the SQL DB could be loaded onto one of my forms at the click of a button. The form needs this information (and more that has to be manually entered) to be complete. ...
2
2245
by: kaustubh.deo | last post by:
Hello, Need your valuable inputs for this scenario. Any pointers would be helpful. I have large data set (few 100s of MB or sometimes may even go up to GB). I populate a DOM tree using this data set and then write this DOM tree to xml file. How should one handle such large data set in xerces, as we cannot have such a large DOM tree in memory. I have a following questions:
4
6573
by: Nate | last post by:
I am looking to populate a Schedule table with information from two other tables. I am able to populate it row by row, but I have created tables that should provide all necessary information for me to be able to automatically populate a "generic" schedule for a few weeks or more at a time. The schedule table contains: (pk) schedule_id, start_datetime, end_datetime, shift_employee,
2
2043
by: Nate | last post by:
I am looking to populate a Schedule table with information from two other tables. I am able to populate it row by row, but I have created tables that should provide all necessary information for me to be able to automatically populate a "generic" schedule for a few weeks or more at a time. The schedule table contains: (pk) schedule_id, start_datetime, end_datetime, shift_employee,
3
7392
by: akristensen | last post by:
I am new to this site, so be patient if I do not ask the question correctly. Current Target Platform: Browser: MS IE, script language: Javascript (will use VBScript, but JS is preferred), External apps: MS Excel What I need to do: From a web page using javascript, I open a new Excel application and sheet, populate some information into it. After it is populated with some information, I need to run the "Solver..." option on the data in the...
3
2741
MattFitzgerald
by: MattFitzgerald | last post by:
My Forms & Tables:- Main form is Frm_LE_List (contains Customer Details) Stored in Tbl_LE_List Which contains subform Frm_VOL_References (Contains Orders known as VOL's) Stored in Tbl_VOL_References This subform has subform Frm_Order_Lines (Contains line items for orders) Stored in Tbl_Order_Lines I also have a table Tbl_Rate_Card_Lookup (This contains information used to populate Tbl_Order_lines Relationships:- Tbl_LE_List is related...
4
4554
ollyb303
by: ollyb303 | last post by:
Hi, wasn't sure whether I should post this under .net, IIS or access, but I've plumped for .net! I have a problem with an asp.net website which I am hosting on a windows server 2003 under IIS 6.0. I am using an access database as the datasource for a gridview - this all works fine when I am running it on the development server in VWD 2005 express on my dev machine, but when I've uploaded the site to the server, I get a stack trace when...
0
10835
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10541
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10585
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7785
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6976
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5818
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4447
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4007
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.