I own one of those old U3 Cruzor USB's, and I want to create an application running on the image/iso/cd part (with a custom flash using "universal customizer") finding the other driver letter, reading an ini (.inf) file and starting an application based on what it finds in that file.
Not sure what language to create it in. But I would like it to be as small, fast and compatible as possible (windows xp, vista, 7. and not requiring .NET framework).
How does I find the driver letters for the USB?
This can be achieved using the DriveInfo
class: http://msdn.microsoft.com/en-us/library/abt1306t.aspx
To get the volume label of the drive do the following.
DriveInfo[] allDrives = DriveInfo.GetDrives();
foreach (DriveInfo d in allDrives)
{
if ((d.IsReady == true) && (d.DriveType == DriveType.Removable))
{
Console.WriteLine(d.VolumeLabel);
}
}
edit: just saw you dont want to use .NET...
精彩评论