Microsoft provide BitLocker technology that keeps the drive encrypted and locked. But there is problem with it once you un-lock it, there is no simple mechanism to lock it back again without a shutdown or restart.
There many tutorial and forum discussions that explain different ways to achieve it. They include making a batch file or running a some commands for each drive.
We have developed an executable that you need to run just once. It will add a "Lock Drive..." in the context menu of BitLocker locked drive.
You can un-install it simple by executing the following command on shell as administrator.
reg delete HKEY_CLASSES_ROOT\Drive\shell\lock-bde
Its is tested and know to be working in Windows 10, Windows 8 and Windows 7.
If you are too paranoid about the security and do not want to execute the given executable you can simply create a vbs file with name lock-bde.vbs
and in it, paste the following code.
' Created by: Shawn Brink
' Tutorial: http://www.eightforums.com/tutorials/21325-lock-drive-add-context-menu-bitlocker-drives.html
Drive = ""
Last = Wscript.Arguments.Count - 1
For n = 0 To Last
Drive = Drive & " " & Wscript.Arguments.Item(n)
Drive = Replace(Drive,":\",":")
CreateObject("Shell.Application").ShellExecute "manage-bde.exe", "-lock -forcedismount " & Drive, "", "runas", 0
now add a registry key so that it appears in the context menu, paste the following lines in a file locker.reg
and executes it as an administrator.
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Tutorial: http://www.eightforums.com/tutorials/21325-lock-drive-add-context-menu-bitlocker-drives.html
"AppliesTo"="System.Volume.BitLockerProtection:=1 OR System.Volume.BitLockerProtection:=3 OR System.Volume.BitLockerProtection:=5 NOT C:"
We just put the above two file into an executable wrapper using Advanced BAT to EXE Converter by www.battoexeconverter.com.