|
|
|
Simple program which can open the USB drives connected to computerThis program can open the USB drives connected to the computer by just running the executable. If there is only one USB drive connected, the program will open the USB drive. If there are more than one USB drives, it will give a screen like this, where you can select the USB drive you want to open.
This utility is very useful to open the pen drives without infecting the viruses in the pen drive. You know if you just double click or right click and select open or explore, the viruses in the pen drive which have edited the autorun.inf will run and infect your computer. When you open the USB drive with this program, there is no such risk. Here is the main function. int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) The program first obtains a list of drives in the system by using the function GetLogicalDrives. Then, the drive type of each logical drive is obtained using GetDriveType and checked whether the drive is a removable drive. The drive letters of all found removable drives are stored in a CStringList. Then, if there is only one removable drive, program just opens it using ShellExecute function. If there are multiple removable drives, program displays a dialog, from which the user can select the removable drive he or she want to open. Then, according to the users' chose, correct removable drive is opened using ShellExecute. You can always download the source code from FrostCode. |