@echo off setlocal EnableExtensions fltmc >nul 2>&1 if errorlevel 1 ( echo Run this check from an elevated command prompt. exit /b 2 ) where manage-bde.exe >nul 2>nul if errorlevel 1 ( echo manage-bde not found. exit /b 2 ) echo BitLocker status manage-bde -status if errorlevel 1 ( echo Failed to read BitLocker status. exit /b 2 ) echo. echo Protection summary powershell.exe -NoProfile -Command "try { Get-BitLockerVolume | Select-Object MountPoint, VolumeStatus, ProtectionStatus, EncryptionPercentage | Format-Table -AutoSize; $off = @(Get-BitLockerVolume | Where-Object { $_.ProtectionStatus -ne 'On' }); if ($off.Count -gt 0) { exit 1 } } catch { Write-Host ('ERROR: ' + $_.Exception.Message); exit 2 }" set "code=%errorlevel%" exit /b %code%