Avatar of Ikelca
Ikelca
Flag for Canada asked on

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

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# ?
.NET ProgrammingEditors IDEsC#

Avatar of undefined
Last Comment
Ikelca

8/22/2022 - Mon
dimaj

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.
Ikelca

ASKER
i rather not to invoke any external windows programs...........
can this be done with c# only?
ASKER CERTIFIED SOLUTION
dimaj

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ikelca

ASKER
nvm, i found a way of doing it thru WMI
Your help has saved me hundreds of hours of internet surfing.
fblack61
Ikelca

ASKER
thanks