0

I am currently using the following script to list the available COM Objects on my machine.

$path = "REGISTRY::HKEY_CLASSES_ROOT\CLSID\*\PROGID"
foreach ($obj in dir $path) {
    write-host $obj.GetValue("")
}

I read on another website that the existence of the InProcServer32 key is evidence that the object is 64 bit compatible.

So using powershell how can I determine the existence of InProcServer32 for each COM Object? If that is even the correct way of establishing whether it is 32 bit or 64 bit.

1 Answer 1

1

I don't know whether that is the way to determine 64-bit compatibility but the way to see if a regkey exists is to use Test-Path e.g.:

PS> Test-Path HKLM:\SOFTWARE
True
PS> Test-Path HKLM:\SOFTWARE2
False

In your case:

$path = "REGISTRY::HKEY_CLASSES_ROOT\CLSID\*\PROGID" 
foreach ($obj in dir $path) { 
    write-host $obj.GetValue("") 
    if (Test-Path (Join-Path $obj.PSParentPath 'InprocServer32'))
    {
        # key exists
    }
} 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.