I am wondering if I can close an explorer window which is communicating with my USB drive. I can get the removable disk and its drive letter by using
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{
if (!drive.IsReady)
{
continue;
}
if (drive.DriveType == DriveType.Removable && isDirectoryEmpty(drive.Name) == true)
{
//do stuff
}
}
How do I do that ? any help would be appreciated.