?
Solved

how to list drive type in c# when there is no drive letter??

Posted on 2011-03-08
5
Medium Priority
?
563 Views
Last Modified: 2013-12-17
just same as title says, i'm trying to create a little program that can assign drive letter to removable drive that has no drive letter assigned by system automatically.
it is mainly under windows.

i have got most of part, but i could not find a way to test if a usb removable drive has drive letter or not.
how can I do this in c# ?
0
Comment
Question by:Ikelca
[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
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:dimaj
ID: 35077884
check out a command called 'fsutil'
It's a windows command that contains a lot of information about windows internals. You can invoke this command from within your C# code by spawning a new process and capturing its output. If you can't capture the output, have the command pipe its results to a text file and then read the text file for your results.

Hope this'll get you started.
0
 

Author Comment

by:Ikelca
ID: 35078251
i rather not to invoke any external windows programs...........
can this be done with c# only?
0
 
LVL 7

Accepted Solution

by:
dimaj earned 2000 total points
ID: 35078331
I briefly scanned through these links and they might have bits and pieces that will help you with your problem:
http://stackoverflow.com/questions/271907/how-to-detect-using-c-if-a-pendrive-is-plugged-into-a-usb-port
http://www.codeproject.com/KB/system/DriveDetector.aspx
0
 

Author Comment

by:Ikelca
ID: 35079959
nvm, i found a way of doing it thru WMI
0
 

Author Comment

by:Ikelca
ID: 35079961
thanks
0

Featured Post

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

752 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