Open with dialog appears when drive is double clicked in windows

This problem is mainly due to the presence of the Autorun.inf file in the root directory of the drive.
For that you will have to make sure that this file is visible and not hidden.
For removing this autorun.inf file, first move to the root directory of the drive where you have this open with problem, using the command prompt. Then we change the permissions of the fle and then we delete the file.
Open
Start > run > cmd
Execute the following instructions one by one in the command prompt.
Cd \
C:
attrib -h -s -r *.inf
del *.inf
Note: You will have to restart or log off for the system to accept changes.
Replace C: in the above command (the second one) with the drive letter from which you want this open with problem eradicated. E.g. D:
Here * is used just to make sure that any INF file (other than the Autorun) will get deleted in the root directory