Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 Trying to get VB Script into VB 2010

$
0
0
Hi,

I've been asked to look at the following script:

http://gallery.technet.microsoft.com...0-1f5085603392

'// ---------------------------------------------------------------------
'// SCRIPT NAME: get-bitlocker-status-c.vbs
'// DATE: 10.06.2010
'// AUTHOR: Adrian Keller
'// DESCRIPTION: Get Protection Status of Drive C:\
'// ---------------------------------------------------------------------

strComputer = "."
Set objShell = CreateObject("Wscript.Shell")
strEnvSysDrive = objShell.ExpandEnvironmentStrings("%SystemDrive%")

Set objWMIServiceBit = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption")
Set colItems = objWMIServiceBit.ExecQuery("SELECT * FROM Win32_EncryptableVolume",,48)

For Each objItem in colItems
If objItem.DriveLetter = strEnvSysDrive Then
strDeviceC = objItem.DeviceID
DriveC = "Win32_EncryptableVolume.DeviceID='"&strDeviceC&"'"
Set objOutParams = objWMIServiceBit.ExecMethod(DriveC, "GetProtectionStatus")
If objOutParams.ProtectionStatus = "1" Then
wscript.Echo "Bitlocker is enabled"
Else
wscript.Echo "Bitlocker is disabled"
End if
End If
Next


All I want to do is get the wscript.Echo to display the text into a label on my form which I know how to do but I can't the script to work.

Does anyone know how I can get this script to work in VB?

Thanks, Al

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>