Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get Drive Letters

Posted on 1999-07-28
15
Medium Priority
?
168 Views
Last Modified: 2010-04-30
How do I find out what drive letters are on ones computer?
0
Comment
Question by:rtcomp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
15 Comments
 
LVL 7

Expert Comment

by:kamall
ID: 1528115
rtcomp,
Didn't you like my code for the 'Default Browser' question?
0
 
LVL 7

Accepted Solution

by:
kamall earned 600 total points
ID: 1528116
Put one Drive List Box control and one command button on your form and enter this code in the command_click event:

For x = 0 To Drive1.ListCount - 1
    Print Drive1.List(x)
Next

Regards.
0
 
LVL 7

Expert Comment

by:kamall
ID: 1528117
You can get only the letters of the drives (w/o volume labels) by modifying the code as shown below:

For x = 0 To Drive1.ListCount - 1
    Print Left$(Drive1.List(x), 1)
Next

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:rtcomp
ID: 1528118
It's not that, I ended up excepted MikeP's answer right away
and didn't realize that you submeted a comment.

I like both of the codes.


0
 
LVL 7

Expert Comment

by:kamall
ID: 1528119
No problem man.
I submitted it in a comment since it is not possible to submit an answer when there is already an answer proposed (the question is locked).
If you would like to award me points by submitting another question, that will be great. If you don't, no problem.
Tip: You can increase the points of this question by an additional 100 points without submitting a new question.
Regards.
0
 

Author Comment

by:rtcomp
ID: 1528120
It wasn't that. I accepted MikeP's answer right away and didn't notice any other remarks. Your code was better and they both did the same.


0
 
LVL 7

Expert Comment

by:kamall
ID: 1528121
Yes, I understand rtcomp.
However, if you want to transfer the points you awarded to MikeP, to me, you can post a question in the EE customer service and request them to do so (only if you see that my code was better and the points had to be awarded to me). Otherwise, you can either post another question, or increase the points for this (current) question.
Thanks.
0
 

Author Comment

by:rtcomp
ID: 1528122
I'll increase the points and accept the answer but do you know the API to get the logical drives.

If not, no prob.

This code will work, but I'll need to use a loop
0
 
LVL 7

Expert Comment

by:kamall
ID: 1528123
Why do you need the API?
This code snipest is pretty short and very nice.
I probably have the API code but I have to check my archieve to see..., I'm not sure.

Why do you need to use a loop?
This code will give you all the drive letters. No loop is required.

Regards.
0
 

Author Comment

by:rtcomp
ID: 1528124
Sorry about the double answer above, my browser was going hey wire on me.

Added 100 pts to question.


0
 
LVL 7

Expert Comment

by:kamall
ID: 1528125
Many thanks rtcomp.
Best regards.
0
 

Author Comment

by:rtcomp
ID: 1528126
I'm making a menu prog. With this menu program I will install some software off a cd rom. Now I do not want to have the user to choose their multi-media drive. I want the program to get the drive letter and then procede with the install on it's own.
0
 
LVL 7

Expert Comment

by:kamall
ID: 1528127
I could not really understand rtcom from your last comment...
Do you have a new problem or just you are expalining to me what you wanted to do with code?
Regards.
0
 

Author Comment

by:rtcomp
ID: 1528128
Just explaing the way the code is supposed to do.
thanks.
0
 
LVL 7

Expert Comment

by:kamall
ID: 1528129
Thank you rtcomp.
You are welcome.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question