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

Copper 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?

2 Replies

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;

@pause

 

 

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.

I would love to have the registry values if you're reading this. Also, could you teach me how to add this to the task scheduler please?