1. Go to Start menu and then to RUN and type"gpedit.msc"(without quotes) and Press Enter.
2. Now you will see a new dialog window , where you will see two things"Computer Configuration"and"User Configuration". Now click on"User Configuration".
3. There you will see three items. Now you have to Click on"Administrative Templates". Then go to"Windows Components".
4. There you will see a lot of Windows Components. Now Click on"Windows Explorer".
5. Now you will find something like this"Prevent Access To Drives From My Computers", double click on it . It will open its properties. Now to lock a drive or drives click on"Enabled"radio button. Now from the drop down menu select the drive that you want to lock or block.
6. After that click on apply and restart your system. Now anyone will not been able to access the particular drive.
7. To unlock the drive again follow the similar procedure and just click on"Not configured"and apply the settings and restart your system.