The first of these 2 locks a BitLocked drive. The 2nd's InvokeMethod
throws: 'Invalid object path'. Why? They seem equivalent.
//Using a search:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2\\Security\\MicrosoftVolumeEncryption", "SELECT * FROM Win32_EncryptableVolume WHERE DriveLetter = 'E:'");
foreach (ManagementObject classInstance1 in searcher.Get())
classInstance1.InvokeMethod("Lock", new object[] { true });
//Direct:
ManagementObject classInstance2 = new ManagementObject("root\\CIMV2\\Security\\MicrosoftVolumeEncryption", "Win32_EncryptableVolume.DriveLetter='E:'", null);
classInstance2.InvokeMethod("Lock", new object[] { 0 });//throws: 'Invalid object path'.