2010-08-12 135 views

回答

-1

編輯:找到了更好的答案。

實際上有一個名爲Win32_EncryptableVolume的WMI類,可能很可能用於以一種很好的方式來完成此操作。它有一個可能有用的Decrypt方法。下面這裏

在Windows 7

舊的答案,看看工具manage-bde.exe,在Vista看劇本manage-bde.wsf

假設他們可以做你想做的事,你應該可以用你的.Net應用程序中的相關參數調用它們。

+0

我不需要解密,只是暫停。我會檢查WMI類是否有這種方法。 – 2010-08-12 12:46:46

+0

@Andrew:是的,我不太瞭解BitLocker,所以不確定你需要什麼。雖然考慮它,也許它是'DisableAutoUnlock',你需要? – 2010-08-12 12:58:42

+0

PowerShell似乎並不知道Win32_類。 – 2010-08-12 13:48:10

0

命令行:

manage-bde -protectors -disable <drive letter>: 
manage-bde -protectors -enable <drive letter>: 

Powershell的(WMI)

$bitlocker = Get-WmiObject -Namespace root\cimv2\Security\MicrosoftVolumeEncryption -Class Win32_EncryptableVolume 
$bitlocker.DisableKeyProtectors() 
$bitlocker.EnableKeyProtectors() 

C#

using System.Management // add reference 
// ... 

// disable Bitlocker 
ManagementObject classInstance = new ManagementObject(@"root\cimv2\Security\MicrosoftVolumeEncryption", "Win32_EncryptableVolume.DriveLetter='C:'", null); 
ManagementBaseObject outParams = classInstance.InvokeMethod("DisableKeyProtectors", null, null); 

// enable Bitlocker 
outParams = classInstance.InvokeMethod("EnableKeyProtectors", null, null); 
相關問題