473,656 Members | 2,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting a volume name.

Hi,

Anyone know how to get a Drive's Volume Label using vb.net?

Thanks in advance.

Eddie
Nov 20 '05 #1
2 7673
Hello,

"Eddie" <ed***@idirect. com> schrieb:
Anyone know how to get a Drive's Volume Label using
vb.net?


\\\
MessageBox.Show (Dir("C:\", FileAttribute.V olume))
///

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
Set a reference to Microsoft Scripting Runtime (COM)

Add

Imports Script

Then:

Dim fso as New FileSystemObjec t
Dim drv as Drive

drv=fso.GetDriv e("C")

MessageBox.Show ("Volume: " & drv.VolumeName)
HTH,

Larry Woods
"Eddie" <ed***@idirect. com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,

Anyone know how to get a Drive's Volume Label using vb.net?

Thanks in advance.

Eddie

Nov 20 '05 #3

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

Similar topics

6
2135
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
3963
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
2997
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
3324
by: Jeff Gaines | last post by:
I am using the 'ManagementObject' 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 'GetVolumeInformation' 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'...
3
4166
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
6119
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
1676
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
3197
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
3150
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
7004
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
8297
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
8816
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
8717
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...
0
7311
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
6162
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
4150
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...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
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.