使用Powershell列出可用的COM对象
我目前正在使用以下脚本列出我机器上可用的COM对象使用Powershell列出可用的COM对象,powershell,com-object,Powershell,Com Object,我目前正在使用以下脚本列出我机器上可用的COM对象 $path = "REGISTRY::HKEY_CLASSES_ROOT\CLSID\*\PROGID" foreach ($obj in dir $path) { write-host $obj.GetValue("") } 我在另一个网站上读到,InProcServer32键的存在证明该对象是64位兼容的 因此,使用powershell如何确定每个COM对象是否存在InProcServer32?如果这是确定它是32位还是64位的正
$path = "REGISTRY::HKEY_CLASSES_ROOT\CLSID\*\PROGID"
foreach ($obj in dir $path) {
write-host $obj.GetValue("")
}
我在另一个网站上读到,InProcServer32键的存在证明该对象是64位兼容的
因此,使用powershell如何确定每个COM对象是否存在InProcServer32?如果这是确定它是32位还是64位的正确方法。我不知道这是否是确定64位兼容性的方法,但查看regkey是否存在的方法是使用测试路径,例如:
PS> Test-Path HKLM:\SOFTWARE
True
PS> Test-Path HKLM:\SOFTWARE2
False
就你而言:
$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
}
}