0 Replies Latest reply on Jul 31, 2010 2:06 PM by BCBeMe

    ActiveX error using the COM object SBAdmCOM.dll with VBS on Windows 7

      Thanks to Simon for the below VBS example script.

      It works great on Windows XP but on Windows 7 it pops the error

      "ActiveX Component can not create oblect...."

       

      I have verified that the SBAdmCom.dll is registered.

      I can get the script to run if I paste the command line into an IE session running as administrator.

       

      Any help is greatly apreciated.

      Thanks

      Bryan

       

       

       

      ----------------------------

      ' simple script to get the current drive crypt state using the COM object SBAdmCOM.dll
      ' you must have this registered, as well as the file sbadmdll.dll - both should usually
      ' be in the EEPC5 client directory.

      ' to register, use regsvr32 sbadmcom.dll from an admin command prompt if you are not
      ' registering the API as part of a normal EEPC file deployment (self-registering dll type).

      ' example script only by Simon Hunt, CTO McAfee - no support, warranties etc.
      ' you can get help though on the encryption forum at http://community.mcafee.com


      Option Explicit

      ' set up some simple XML
      Dim XML : XML="<SafeBoot><SbAdminScripting><SbAdminCommand><Command>GetCryptState</Comman d>" & _
      "<CommandRef>my_reference_string</CommandRef><ResultCode>0x00000000</ResultCode >" &  _
      "<ResultDescription>Success</ResultDescription></SbAdminCommand></SbAdminScript ing></SafeBoot>"
       
      ' Connect to the COM object
      Dim SBObj : Set sbobj = CreateObject("SbAdmCom.SbAdmScripting")

      ' run the command and retrieve the result
      Dim result : result = sbobj.execute(XML)

      ' process the result
      Dim lines : lines = Split(result,vbCrLf)

      Dim line,strTemp,i,x,currentdrive,currentdrivecrypt

      For i = 0 To UBound(lines)
      x = InStr(1,lines(i),"<Drive Letter",vbTextCompare)
      If x>0 Then
        ' line contans the tag - strip out the drive letter and mode.
        currentdrive = Mid(lines(i),x+15,1)
        strTemp = Replace(lines(i+1)," ","")
        currentdrivecrypt = Mid(strTemp,8,Len(strTemp)-15)
        WScript.Echo "Drive: " & currentdrive & " Crypt Mode: " & currentdrivecrypt
      End If
      next

      'uncomment the line below to show the actual output.
      'WScript.Echo result