Bitlocker script to unlock the drive

What I'm trying to achieve is to create a very small script to unlock my blocker drive using a password, not a recovery password.

There is a Microsoft team for this, which:

manage-bde -unlock D: -password

where Dis my locker bit. If I run this command line, it will ask me for a password, and then the disk will be correctly unlocked.

At first I thought of creating a variable to request a password for the user, and then use this variable in the above command line, so the script would look like this:

set /p pass= what is your pass
manage-bde -unlock D: -password %pass%

The problem is that -passwordit does not seem to accept any argument, whether it is a variable or a password in a clear form, it will fail. Thus, the only way to make it work seems to be an automatic response to a password request, with the data in the variable. But I do not know how to do this. I guess after manage-dbe...

additional command line added

My programming skills are pretty weak, so any help would be appreciated.

+5
source share
8 answers

Late, but as mentioned here , you can easily do this with just a few lines, unless you have any problem using PowerShell:

PS C:\> $SecureString = ConvertTo-SecureString "fjuksAS1337" -AsPlainText -Force
PS C:\> Unlock-BitLocker -MountPoint "E:" -Password $SecureString
+6
source

, - . , , , . , , Bitlocker.

script, . ( ). , (schtasks.exe), .

script , , Bitlocker. script , ..

.CMD, . script, [script name] [Bitlocker volume letter]. , unlock x. .

, !

@echo off & cls

set Volume=%1:

echo.

manage-bde.exe -unlock -password %Volume%

echo. & pause & echo.

:: End of script
+1

Unlock-BitLocker , script:

$key = Read-Host 'Enter Bitlocker Password!' -AsSecureString

Unlock-Bitlocker -MountPoint "Y:" -Password $key
Unlock-Bitlocker -MountPoint "Z:" -Password $key
+1

, , . .

:

  • , .
  • script, C Safeboot ( ), .
  • script, , !

cscript C:\Windows\System32\manage-bde.wsf -unlock d: -recoverypassword 215270-XXXXXX-345807-005038-278652-077022-634964-379346

0

β†’ Bitlocker D .

recorvery . (: 240536-642752-211409-491690-520026-693407-016863-529159), .

: manage-bde -unlock D: -recoverypassword 240536-642752-211409-491690-520026-693407-016863-529159

0

MSFT, , -. , (, F: X:)

$pass = Read-Host "Password for $devVHD" -AsSecureString
mount-diskimage -ImagePath $devVHD
$unlckDrive = (Get-BitLockerVolume | where {$_.CapacityGB -eq 0}).mountpoint
Unlock-BitLocker -MountPoint $unlckDrive -Password $pass    
0

.bat.

Task Scheduler script . , :

@echo off
manage-bde D: -unlock -recoverypassword XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX
pause
0

use -recoverypassword switch and write your recovery pwd, it works for me;)

EDIT: manage-bde -unlock D: -recoverypassword manage-bde -unlock D: -recoverypassword XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX

-1
source

All Articles