SWBemObjectSet :: Generic Failure

Discussion in 'Scripting' started by Trevor, Jan 5, 2006.

  1. Trevor

    Trevor Guest

    Hello, I really need some help with this please! :) I keep getting an
    SWBemObjectSet :: Generic Failure when I run this piece of code! I am
    creating a script to find AutoCAD 2004 on computers, and here is what
    the applicable section of code looks like, thanks:

    function findAutoCAD(strComp)
    strNamespace= "root\cimv2"
    qryProduct= "SELECT * From Win32_Product WHERE caption='AutoCAD 2004'"
    strConn = "winmgmts:\\" & strComp & "\" & strNamespace
    Set objWMI = GetObject(strConn)
    Set qryResult = objWMI.ExecQuery(qryProduct)
    wscript.echo qryResult.count

    'if qryResult.Count <> 0 then
    ' set findAutoCAD = true
    ' wscript.echo "AutoCAD found!"
    'else
    'AutoCAD not found on system
    'end if
    wscript.echo "done"
    end function
     
    Trevor, Jan 5, 2006
    #1
    1. Advertisements

  2. Trevor

    Trevor Guest

    Well I did some research and found out that this is some sort of DCOM
    permissions problem. I'm curious if anyone has suggestions as to what
    this could be or what steps I should take to make sure I'm getting
    proper permissions to the WMI service. Thanks
     
    Trevor, Jan 5, 2006
    #2
    1. Advertisements

  3. Trevor

    RichS Guest

    Check Knowledge Base (KB) article 875605 for interaction of WMI and XP SP2
     
    RichS, Jan 6, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.