@ECHO OFF

set log=SusBde.txt

echo [BitLocker Suspend Tool]
echo [BitLocker Suspend Tool] > %log%

:SuspendBde
set suspend=0
%SystemRoot%\Sysnative\manage-bde -protectors -get c: | find "TPM"
if %ERRORLEVEL% NEQ 0 goto SuspendBdeD
%SystemRoot%\Sysnative\manage-bde -protectors -disable c: >> %log%
set suspend=1
Echo Suspended Drive C:
Echo Suspended Drive C: >> %log%

:SuspendBdeD
%SystemRoot%\Sysnative\manage-bde -protectors -get d: | find "TPM"
if %ERRORLEVEL% NEQ 0 goto SuspendBdeE
%SystemRoot%\Sysnative\manage-bde -protectors -disable d: >> %log%
set suspend=1
Echo Suspended Drive D:
Echo Suspended Drive D: >> %log%

:SuspendBdeE
%SystemRoot%\Sysnative\manage-bde -protectors -get e: | find "TPM"
if %ERRORLEVEL% NEQ 0 goto SuspendBdeF
%SystemRoot%\Sysnative\manage-bde -protectors -disable e: >> %log%
set suspend=1
Echo Suspended Drive E:
Echo Suspended Drive E: >> %log%

:SuspendBdeF
%SystemRoot%\Sysnative\manage-bde -protectors -get f: | find "TPM"
if %ERRORLEVEL% NEQ 0 goto SuspendBdeG
%SystemRoot%\Sysnative\manage-bde -protectors -disable f: >> %log%
set suspend=1
Echo Suspended Drive F:
Echo Suspended Drive F: >> %log%

:SuspendBdeG
%SystemRoot%\Sysnative\manage-bde -protectors -get g: | find "TPM"
if %ERRORLEVEL% NEQ 0 goto SuspendBdeDone
%SystemRoot%\Sysnative\manage-bde -protectors -disable g: >> %log%
set suspend=1
Echo Suspended Drive G:
Echo Suspended Drive G: >> %log%

:SuspendBdeDone
if %suspend% EQU 1 goto BdeSuspend

:BdeNotSuspend
echo Not found BitLocker volume
echo Not found BitLocker volume >> %log%
exit /b 1
:BdeSuspend
echo BitLocker Successfully suspended
echo BitLocker Successfully suspended >> %log%
exit /b 0