Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitlocker script to unlock drive

What I am trying to achieve is to create a very small script to unlock my bitlocker drive, using the password, not the recovery password.

There is a Microsoft command for that, which is:

manage-bde -unlock D: -password

where D is my bit locker drive. If I run this command line it will ask me for the password, and then the drive is properly unlocked.

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

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

The problem is that -password does not seem to accept any argument, would it be the variable, or the password in clear, it will fail. So, the only way to make it work seems to be an automatic reply to the prompt for the password, with the data in the variable. But I don't know how to do that. I assume there is an extra command line to add after the manage-dbe...

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

like image 900
user2154222 Avatar asked Mar 10 '13 16:03

user2154222


People also ask

How do I unlock BitLocker drive from command prompt?

Unlock BitLocker Drives from Command PromptStep 1: Run Command Prompt as an admin. Step 2: Execute the command: manage-bde -unlock (drive letter): -password. The drive letter here is the one of the BitLocker drive you want to unlock. Step 3: Type the BitLocker password and press Enter button to confirm your password.

How do I bypass BitLocker on a hard drive?

There is no way to bypass the BitLocker recovery key when you want to unlock a BitLocker encrypted drive without a password. However, you can reformat the drive to remove the encryption, which needs no password or recovery key.

How do I permanently unlock BitLocker?

2) Through Windows GUI mode Click Start, click Control Panel, click System and Security, and then click BitLocker Drive Encryption. Look for the drive on which you want BitLocker Drive Encryption turned off, and click Turn Off BitLocker.


1 Answers

Kind of late to the party but as mentioned here you can easily do this with only a couple of lines, if you don't have any problem using PowerShell:

PS C:\> $SecureString = ConvertTo-SecureString "fjuksAS1337" -AsPlainText -Force
PS C:\> Unlock-BitLocker -MountPoint "E:" -Password $SecureString
like image 139
Konstantinos Goutsos Avatar answered Nov 15 '22 15:11

Konstantinos Goutsos