Skip to content

Instantly share code, notes, and snippets.

@maciakl
Created July 1, 2022 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciakl/3a88e4499ae2867a21c22cf91a9e3841 to your computer and use it in GitHub Desktop.
Save maciakl/3a88e4499ae2867a21c22cf91a9e3841 to your computer and use it in GitHub Desktop.
Interactive helper script that will initiate decryption of a bitlocer drive then monitor the progress.
@echo off
if "%1" == "elevated" goto start
powershell -command "Start-Process %~nx0 elevated -Verb runas"
goto :eof
:start
@echo off
cls
CALL :HEAD
CALL :CHECK
echo.
echo.
choice /M "Decrypt [D], or Quit [Q]" /C DQ
echo.
if %ERRORLEVEL% == 1 ( CALL :DECRYPT )
if %ERRORLEVEL% == 2 ( goto :eof )
goto :start
:HEAD
cls
echo.
echo BDE Helper
echo ==========
echo.
goto :eof
:DECRYPT
echo.
manage-bde -off c:
echo.
goto :LOOP
goto :eof
:CHECK
echo.
manage-bde -status c:
echo.
goto :eof
:LOOP
CALL :HEAD
CALL :CHECK
echo [Close the window to quit]
timeout 5
goto LOOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment