Auto lock external bitlocker encrypted drive, when idle or with lock screen

Occasional Contributor

Any chance? Today we need to script (manage-bde D/E/F: -lock) task schedule event (on workstation lock/unlock), to lock external or data drives when AFK. 


EDIT: And a context menu to lock/unlock those drives?

1 Reply

Hi @dvaguirre,


Please follow the step, I hope the solution could be useful for your Bitlocker application.


1. Copy the below script and save it as bde.cmd inside the folder at c:\bde-script.



@echo off
Title BitLocker Drive Auto-Lock

if exist d:\ %windir%\system32\manage-bde -lock d:
if exist e:\ %windir%\system32\manage-bde -lock e:
if exist f:\ %windir%\system32\manage-bde -lock f:
if exist g:\ %windir%\system32\manage-bde -lock g:
if exist h:\ %windir%\system32\manage-bde -lock h:

REM You can add more drive letters as per your requirement;




You can run it manually from the RUN command (WIN +R), or you can add the Task scheduler. There is the possibility that we can add it to the context menu, if you need I can also share the registry values.