Windows 8 and 8.1 Forums


"Lock Drive" - Add to Context Menu of BitLocker Drives

  1. #1
    "Lock Drive" - Add to Context Menu of BitLocker Drives

    "Lock Drive" - Add to Context Menu of BitLocker Drives
    Add "Lock Drive" to Unlocked BitLocker Drives Context Menu in Windows 7 and Windows 8
    Published by Brink is online now
    02 Mar 2013
    Default "Lock Drive" - Add to Context Menu of BitLocker Drives

    Published by


    Brink's Avatar
    Administrator

    Join Date: Jul 2009
    Posts: 22,274

    Add "Lock Drive" to Unlocked BitLocker Drives Context Menu in Windows 7 and Windows 8


    information   Information
    To lock an unlocked fixed data drive (ex: internal hard drive) encrypted by BitLocker, you would normally restart the computer.

    To lock an unlocked removable data drive (ex: USB drive) encrypted by BitLocker, you would normally disconnect it or restart the computer.

    In Windows 8, if you have auto-unlock turned on for a data drive, then it will automatically be unlocked when connected (removable data drive) or you sign in to Windows 8 (fixed data drive).


    This tutorial will show you how to add "Lock Drive" to the context menu of all unlocked fixed and removable data drives encrypted by BitLocker to be able to lock the drive in Windows 7 and Windows 8 without having to restart the computer for fixed data drives, disconnect removable data drives, and still be able to leave auto-unlock turned on for any data drives.

    Note   Note
    You must be signed in as an administrator to be able to do the steps in the tutorial, and to be able to use the "Lock Drive" context menu item.

    "Lock Drive" is purposely not added to the context menu of the C: OS drive since it contains the current running operating system, and cannot be locked while Windows 8 is running.

    warning   Warning
    In Windows 7, BitLocker Drive Encryption is only available in the Windows 7 Ultimate and Windows 7 Enterprise editions.

    In Windows 8, BitLocker Drive Encryption is only available in the Windows 8 Pro and Windows 8 Enterprise editions.


    EXAMPLE: "Lock Drive" in Context Menu

    Click image for larger version





    "Lock Drive" - Add to Context Menu of BitLocker Drives OPTION ONE "Lock Drive" - Add to Context Menu of BitLocker Drives
    To Add "Lock Drive" to Context Menu of Unlocked BitLocker Drives

    1. Click/tap on the Download button below to download the .ZIP file below.

    Add_Lock_Drive_to_Context_Menu.zip


    download

    2. Save the .ZIP file to your desktop, and open it.

    3. Extract (drag and drop) the contents (.vbs and .reg files) from inside the ZIP file to your desktop.

    4. Unblock the extracted lock-bde.vbs file.

    5. In File Explorer (Windows 8) or Windows Explorer (Windows 7), navigate to C:\Windows\System32, and copy/move the lock-bde.vbs file into the System32 folder.

    6. If prompted, click/tap on Continue and Yes to approve.

    7. Double click/tap on the extracted .reg file to merge it.

    8. If prompted, click/tap on Run, Yes (UAC), Yes, and OK.


    Note   Note
    When you lock a drive encrypted by BitLocker, you will be prompted by UAC to click/tap on "Yes" to approve first. After a moment, the drive will be locked.

    If the drive has been turned off due to being idle, then it will take a few more seconds to be locked while it waits for the HDD to spin back up.






    "Lock Drive" - Add to Context Menu of BitLocker Drives OPTION TWO "Lock Drive" - Add to Context Menu of BitLocker Drives
    Remove "Lock Drive" from Context Menu of Unlocked BitLocker Drives

    NOTE: This is the default setting.

    1. Click/tap on the Download button below to download the .reg file below.

    Remove_Lock_Drive_from_Context_Menu.reg

    download

    2. Save the .reg file to your desktop.

    3. Double click/tap on the .reg file to merge it.

    4. If prompted, click/tap on Run, Yes (UAC), Yes, and OK.

    5. In File Explorer (Windows 8) or Windows Explorer (Windows 7), navigate to C:\Windows\System32, and delete the lock-bde.vbs file.

    6. If prompted, click/tap on Yes (UAC) to approve deleting the lock-bde.vbs file.


    That's it,
    Shawn


    Related Tutorials



  2. #1


    Posts : 34
    Windows 8.1 Pro x64


    Works great. Thanks!

    I think there must be a way to combine the VBS file with Task Scheduler to bypass UAC, making the locking of a drive an even easier task...

      My System SpecsSystem Spec

  3. #2


    Posts : 22,274
    64-bit Windows 10


    You're welcome. Not sure that would work since UAC is required to lock the drive again.
      My System SpecsSystem Spec

  4. #3


    Posts : 34
    Windows 8.1 Pro x64


    I almost made it work, but "almost" doesn't cut it. The problem is I don't know of any way to pass the drive letter as a variable to Task Scheduler. If that were possible, it would be an easy thing to set up overall.
      My System SpecsSystem Spec

  5. #4


    Posts : 22,274
    64-bit Windows 10


    Yeah, that's the problem I had as well.
      My System SpecsSystem Spec

  6. #5


    Posts : 34
    Windows 8.1 Pro x64


    Just an FYI to all... When I updated to Windows 8.1, the HKLM\SOFTWARE\Classes\Drive\shell\lock-bde key was totally deleted. The function still works in Win8.1 once you add it back.
      My System SpecsSystem Spec

  7. #6


    Posts : 2
    Windows 8.1 Pro


    This is perfect! By the way, is there an easy way to have the system automatically prompt me for the unlock password once I login into Windows? I know I can turn on auto-unlock but that requires me to encrypt my system drive, which for various reasons is not an option right now. So maybe a vbs that runs manage-bde -unlock x: -pw would do the trick?
      My System SpecsSystem Spec

  8. #7


    Posts : 34
    Windows 8.1 Pro x64


    Sure there is. This is a simple little script I use to unlock my drives from an elevated command prompt. You could run a modified version of it at startup. Run it from Task Scheduler to make it run elevated without a UAC prompt. It takes the desired volume letter as a parameter, so the command line should be "x:\path\scriptname.cmd y", where "y" is the desired volume drive letter.

    Code:
    @echo off & cls & setlocal
    
    set Volume=%1:
    
    echo.
    
    if exist %1:\ (
    echo ERROR: The volume is already unlocked.
    echo.
    pause
    exit)
    
    for /f "tokens=1,2*" %%a in ('bcdedit.exe') do if (%%a)==(Access) goto :NoAdmin
    
    echo.
    
    manage-bde.exe -unlock -password %Volume%
    
    echo.
    pause
    echo.
    exit
    
    :NoAdmin
    
    echo.
    echo Administrative rights not detected. Exiting.
    echo.
    pause
    goto :EOF
    
    :: End of script
    Last edited by crosspatch; 16 Jul 2014 at 20:01.
      My System SpecsSystem Spec

  9. #8


    Posts : 2
    Windows 8.1 Pro


    Thanks, I will give it a try.
      My System SpecsSystem Spec

  10. #9


    Posts : 8
    Win 8.1


    Quote Originally Posted by crosspatch View Post
    This is a simple little script I use to unlock my drives from an elevated command prompt.
    How would a similar Scheduler run script look like to open a standard BitLocker "Enter Password" Dialog Box for an encrypted drive at user logon?
      My System SpecsSystem Spec

Page 1 of 7 123 ... LastLast
"Lock Drive" - Add to Context Menu of BitLocker Drives
Related Threads
How to Change the Default Program of the "Edit" Context Menu in Windows This tutorial will show you how to change the default program that the "Edit" context menu item opens a file with to edit it in Vista, Windows 7, and Windows 8. This is only applied to the user account that uses this,...
I want to remove the option of “Format” from context menu for drives. Could I get some help on how to do this?
Hi, I'm using Windows 8.1 x64 and I'd like to add to the MAIN menu of context menu (just right-clicking) the options to create a New Folder and a New Text Document. Right now I have to go to the "New" option and then select Folder or Text Document. Thanks! :party:
Hello Brink, Instead of having shortcuts on my desktop, could I use a similar trick to add a "shortcut" Cascading Desktop Context Menu in Windows 8.1, under of which I can have all my shortcuts to applications or files? I have a file named registry.vbs with which I open directly a key in the...
How to Add Quick Launch to "Send to" Context Menu in Vista, Windows 7, and Windows 8 This will show you how to add Quick Launch to the Send to context menu of your user account in Vista, Windows 7, and Windows 8. This will make it easer to add a copy of items you want to Quick Launch on...
How to Add "List Hidden Files" to Context Menu in Vista, Windows 7, and Windows 8 This tutorial will show you how to add "List Hidden Files" to the context menu of folders and drives to get a list of all hidden files in them in Vista, Windows 7, and Windows 8. While you must be signed in as...
How to Add "List Read-only Files" to Context Menu in Vista, Windows 7, and Windows 8 This tutorial will show you how to add "List Read-only Files" to the context menu of folders and drives to get a list of all read-only files in them in Vista, Windows 7, and Windows 8. While you must be...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook