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.
Alternate Method
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 in
%SYSTEMROOT%System32
and in it, paste the following code.
' Created by: Shawn Brink
' http://www.eightforums.com
' 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)
Next
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
; http://www.eightforums.com
; Tutorial: http://www.eightforums.com/tutorials/21325-lock-drive-add-context-menu-bitlocker-drives.html
[HKEY_CLASSES_ROOT\Drive\shell\lock-bde]
"AppliesTo"="System.Volume.BitLockerProtection:=1 OR System.Volume.BitLockerProtection:=3 OR System.Volume.BitLockerProtection:=5 NOT C:"
@="Lock Drive..."
"HasLUAShield"=""
"MultiSelectModel"="Single"
[HKEY_CLASSES_ROOT\Drive\shell\lock-bde\command]
@=hex(2):77,00,73,00,63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,\
00,6c,00,6f,00,63,00,6b,00,2d,00,62,00,64,00,65,00,2e,00,76,00,62,00,73,00,\
20,00,25,00,31,00,00,00
We just put the above two file into an executable wrapper using Advanced BAT to EXE Converter by www.battoexeconverter.com.