2

I want to unlock my volume locked with BitLocker from command prompt, the command I searched on the internet is :

manage-bde -unlock E: -RecoveryPassword "mypassword"

But my password has space between its characters and it does not work. Even if I put it between quotes. How can I resolve it?

5
  • 2
    It's asking for the 48 digit recovery password not the user password technet.microsoft.com/en-us/library/… Aug 25, 2015 at 10:57
  • @DavidMarshall , so how can I enter my password from cmd? I cannot find anything in the page you have refrenced. thanks.
    – abdolahS
    Aug 25, 2015 at 14:12
  • As far as I know there is no way. It's probably a security feature to prevent the password being stored in clear in batch files. Aug 25, 2015 at 14:38
  • @DavidMarshall , Is it possible to fed password from another file or another command to it? (e.g I've two files: one unlock.bat which contains "manage-bde -unlock H: -password " and one which sends or outputs the password , and then using command like : sendPass.bat | unlock.bat sends password as parameter to unlock.bat)?
    – abdolahS
    Aug 29, 2015 at 14:58
  • The -password parameter causes a prompt for the password. The -recoverykey parameter allows you to have a recovery key file to unlock the drive. Aug 29, 2015 at 17:39

3 Answers 3

5

As David mentions use

C:\Windows\System32>manage-bde -unlock D: -Password Enter the password to unlock this volume:

This is an active prompt. You cannot enter your password in the same line, you have to wait for the prompt.

Therefore an alternative:

C:\Windows\System32>manage-bde -unlock D: -RecoveryKey "D:\path\keyfile.bek"

It is more easily to handle with the batch files you mention than the password. Protect access to the keyfile though.

Take note that the -RecoveryKey is a little confusing. It won't work with the .txt-recovery-file which is actually called RecoveryPassword; it works with a start-up key or recovery key which both are an external key file. (*.bek).

You can add such key with command, start with manage-bde -protectors -add /? This will display help and examples so you can choose a new type of key for your drive.

For your overview:

  • Recovery Password: Numerical Password
  • Password : Human defined password
  • RecoveryKey : *.bek file containing a very long complicated key.
  • StartupKey : the same as RecoveryKey, *.bek, for use during boot.
  • Others types available, run the mentioned /? command.
2

You can pass the password directly on the command line if you use PowerShell:

Unlock-Bitlocker d: -Password (ConvertTo-SecureString "YourPassword" -AsPlainText -Force)

As has already been said, manage-bde tries to force a human to type the password for good reason, avoiding embedding passwords in clear text within .bat/.ps1 files. However, there are valid reasons for doing this so long as care is taken in a trusted environment. The docs for the last two switches point out just one of the many ways this could be harmful:

-AsPlainText: Specifies a plain text string to convert to a secure string. The secure string cmdlets help protect confidential text. The text is encrypted for privacy and is deleted from computer memory after it is used. If you use this parameter to provide plain text as input, the system cannot protect that input in this manner. To use this parameter, you must also specify the Force parameter.

-Force: Confirms that you understand the implications of using the AsPlainText parameter and still want to use it.

0

My crazy situation goes like this....

At first I had 2 BitLocker volumes that unlocked them running an .bat file, do backup and lock them back by a bat file again.

Everything was peachy and roses till for my (dumb) reasons had to format one of the two drives.

Then re-enable BitLocker to the formatted drive.

Now when I went to unlock the volume I run a bat file as usual and I meet the dreadful error unlocked but cant be accessed (for no reason).

Accidentally I found a workaround for that problem, if I do an unlock-lock-unlock than everything is fine and the drive can accessed normally!

And to drive nuts the whole thing that is needed ONLY for the newest BitLocker volume, the old BitLocker volume works on a unlock one time use it right after manner as usual.

Only the new BitLocker volume needed to be unlocked twice (facepalm)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .