Hi,
the code below show how to get all drives on the computer, i think you could use it to solve your problem
//get the drive names on the target computer
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{
//Console.WriteLine("Drive: {0} {1}", drive.Name, drive.DriveType);
if (drive.DriveType.ToString() == "Fixed")
{
try
{
//Search for the folder in each drive
string[] dirs = Directory.GetDirectories(drive.Name, "MySql", SearchOption.AllDirectories);
Console.WriteLine("The number of directories found is {0}.", dirs.Length);
foreach (string dir in dirs)
{
Console.WriteLine(dir);
}
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
} good luck
Please mark this post as answered if it helped you!
mY BlOg