473,805 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting Volume Name


I am using the 'ManagementObje ct' to get the volume name of each drive
on my PC. It works but it is a bottleneck.

Is there an quicker way to get this information? I am using C# but am
happy yo make API calls.

I have tried the API call 'GetVolumeInfor mation' which returns the
drive letter rather than the volume name and also another function
(name forgotten) which returned a string that looked like it might be
the volume 'unique' number allocated by formatting a drive.

The VB function 'Dir' looks like it might work but I have been unable
to get to it from C#.

Any help appreciated.
--
Jeff Gaines Damerham Hampshire UK

Nov 15 '05 #1
3 3328
GetVolumeInform ation returns the path, the volume name, and the serial
number as well as some other data.
-mike
MVP

"Jeff Gaines" <je**@jgaines.c o.uk> wrote in message
news:tm******** *************** *********@4ax.c om...

I am using the 'ManagementObje ct' to get the volume name of each drive
on my PC. It works but it is a bottleneck.

Is there an quicker way to get this information? I am using C# but am
happy yo make API calls.

I have tried the API call 'GetVolumeInfor mation' which returns the
drive letter rather than the volume name and also another function
(name forgotten) which returned a string that looked like it might be
the volume 'unique' number allocated by formatting a drive.

The VB function 'Dir' looks like it might work but I have been unable
to get to it from C#.

Any help appreciated.
--
Jeff Gaines Damerham Hampshire UK

Nov 15 '05 #2

Michael

Thanks for your response, I made a mess of the DLL prototype (why
aren't they built in to a 'C' based language) and all is well now.
On Tue, 11 Nov 2003 11:58:10 -0600, "Michael Giagnocavo [MVP]"
<mg*******@Atre vido.net> wrote:
GetVolumeInfor mation returns the path, the volume name, and the serial
number as well as some other data.
-mike
MVP

"Jeff Gaines" <je**@jgaines.c o.uk> wrote in message
news:tm******* *************** **********@4ax. com...

I am using the 'ManagementObje ct' to get the volume name of each drive
on my PC. It works but it is a bottleneck.

Is there an quicker way to get this information? I am using C# but am
happy yo make API calls.

I have tried the API call 'GetVolumeInfor mation' which returns the
drive letter rather than the volume name and also another function
(name forgotten) which returned a string that looked like it might be
the volume 'unique' number allocated by formatting a drive.

The VB function 'Dir' looks like it might work but I have been unable
to get to it from C#.

Any help appreciated.
--
Jeff Gaines Damerham Hampshire UK


--
Jeff Gaines Damerham Hampshire UK

Nov 15 '05 #3
ManagementObjec t should be (almost) as fast as 'GetVolumeInfor mation' API call as it uses the same API.
What OS are you running, and how does your code looks like?

Willy.
"Jeff Gaines" <je**@jgaines.c o.uk> wrote in message news:tm******** *************** *********@4ax.c om...

I am using the 'ManagementObje ct' to get the volume name of each drive
on my PC. It works but it is a bottleneck.

Is there an quicker way to get this information? I am using C# but am
happy yo make API calls.

I have tried the API call 'GetVolumeInfor mation' which returns the
drive letter rather than the volume name and also another function
(name forgotten) which returned a string that looked like it might be
the volume 'unique' number allocated by formatting a drive.

The VB function 'Dir' looks like it might work but I have been unable
to get to it from C#.

Any help appreciated.
--
Jeff Gaines Damerham Hampshire UK

Nov 15 '05 #4

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

Similar topics

6
2142
by: E G | last post by:
Hi! I am having problems in designing a class. First, I have a base class that allocates a 3D data set and allows some other mathematical operations with it, something like this: template <typename T> class BasicArray {
21
4007
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does nothing in IE. I'd be greatful for any assistance. Also, if I will have problems the code on Opera or Safari, I'd appreciate any pointers--I don't have a Mac to test Safari. THanks very much, Michael
4
3012
by: murrayatuptowngallery | last post by:
I have looked at some mouseover/ sound object scripts and can't get them to work. Most were more complex than needed and introduced several new parameters for me. I found a simple pair of html code segments that accomplish display of an image and automatic 'display' (playback) of a .wav file, and apparently are usable for both IE and NS, " <object height="100%" width="100%"
3
4179
by: Jefe | last post by:
Hi group I'm trying to implement a console application which work just lie "Dir" instruction in MS-Dos prompt window so I need to display Volume Serial Number and also the free space, how can I get Volume Serial Number and other related informations and is there any function in .Net which will return the available free space in a specified drive? Regards,
16
6162
by: Basil Fawlty | last post by:
Hi everyone, I have an assignment, to create a simple VB program that computes the volume of a cylinder. The Form is pretty simple, it has a label and text box for base radius, another for height and another for volume with an OK button. I have the code to put into the OK button (Which I've done): Private Sub OK_Click( ) --not this line r = Val(radius.Text) --input this line h = Val(hght.Text) --input this...
1
1696
devonknows
by: devonknows | last post by:
I was wondering if any of you vb guru's can help me with this, im buildign a simple computer monitor that monitors vcertain aspects of the machine, page file usage, physcial memory, logical drive data n such, i wondering can any of you help me in getting a volume name if possible i have a guess it is GetVolumeInformation with the api, but im not sure how to invoke it or use it, i wanna create a public function like getdrivename(drivename as...
1
3214
by: arozow | last post by:
I want to control the volume. But it's not working. <object id="dmo" name="dmo" class="dmo" hidden="true" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="0" > <param name="src" value="http://montaigne.univ-paris3.fr/ram//RSN/semaine1/Mus_Int_DJ_Francois.ram"> <param name="console" value="radio"> <param name="controls" value="all"> <param name="autostart"...
4
3177
by: Benjamins via AccessMonster.com | last post by:
Hi, I have used CreateObject("Scripting.FileSystemObject") to get the disk volume. Is there any other way of get the disk volume other than using the FSO. Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200801/1
185
7146
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will return the file name given a FILE *. Questions: What would be the best name for this function?
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10613
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...
1
10368
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
10107
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...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
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
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4327
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
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.