Windows 7 comes with Bitlocker which let you encrypt the whole drive and puts a lock on it so that no one can access your precious data. The drive gets locked after encryption and can only be opened after authentication.
How to encrypt the drive
Right Click on the drive you want to lock and select Turn on Bitlocker.
Select Use a password to unlock the drive and type the password.
Save the recovery key to a folder which will be used to recover the contents in case you forget the password.
The drive will be encrypted now. The time taken for encryption depends on the size of drive. Mine took the time while I wrote this post.
Now you need to provide the password before you can access the contents of the drive.
How to unlock it
When you double click the drive, you will be prompted for a password or any other method that you may have chosen to unlock this drive.
When you type in the password, the drive will be unlocked.
How to lock it
Microsoft doesn’t provide any way of locking the drive again without rebooting the computer but you can do that through Command line interface.
Run Command Prompt as administrator or else it won’t work.
Command to lock the drive is – manage-bde -lock E: forcedismount
Replace the E: with the drive letter of the drive you have locked. The drive will be locked after issuing the command. I will look for an easy way of locking the drive again but till then you can lock the drive by the above method.
Leave a comment if you need any help and I will try my best to help you.