Sometimes we need to prevent users to access the hard drives in My Computer, for that most of the people use various third party software, but Microsoft windows has it's own inbuilt option to do that.
If you enable this setting in "Group Policy" user cannot open folders and access the contents of these Drive, Also they cannot use the Run dialog box to view the files and folders on these drives.
To use this settings go through the following steps:-
Click on the start button then run or simply hit Windows key + R on the keyboard type gpedit.msc in run dialog box then press Enter.
The Group Policy window will appear double click on Administrative Templates under User Configuration.
Then Double click on Windows Components then click on Windows Explorer and from the right panel double click on the "Prevent access to drives from My Computer" select Enabled and chose a combination from the drop down box you can select Restrict All drives to restrict all drives or select one of the combinations, then click Apply & OK.