簡體   English   中英

如何讓 Python 的 winreg 看到注冊表中在 Adobe CC 程序的注冊表編輯器中可見的條目?

[英]How to make Python's winreg see entries in the registry that are visible in the Registry Editor for Adobe CC programs?

我正在嘗試使用 python 的winreg庫來訪問 Adobe 產品(Photoshop、After Effects 等)的注冊表項,雖然我可以在注冊表編輯器中看到HKEY_LOCAL_MACHINE子鍵,但 Python 似乎看不到相同的鍵。 是否有需要更改的權限,或者我以錯誤的方式接近這個?

這是一個總結迄今為止結果的屏幕截圖

我正在運行的代碼是:

import winreg
i=0
while True:
    try:
        # self.aeKey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Adobe\\After Effects\\16.0")
        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Adobe\Setup\Reader")

        printTest = winreg.EnumKey(key, i)
        print(printTest)
        i+=1
    except WindowsError:
        break

這導致我返回

Acrobat Distiller
Acrobat PDFMaker
Adobe AIR
Adobe ARM
CommonFiles
ExtendScript Toolkit
ExtensionManager
PDF Admin Settings
Registration
Repair
Setup

但不是

Adobe BridgeAdobe AcrobatAfter EffectsPhotoshop等。

編輯:我目前正在運行 32 位 Python。

評論中的@martineau 直擊頭部。 我需要更改訪問密鑰以允許找到 64 位注冊表。

import winreg
i=0
while True:
    try:
        # self.aeKey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Adobe\\After Effects\\16.0")
        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Adobe",0, winreg.KEY_READ | winreg.KEY_WOW64_64KEY)
        assert key != None, "Key = None"
        printTest = winreg.EnumKey(key, i)
        print(printTest)
        i+=1
    except WindowsError:
        break

現在生產

Acrobat Distiller
Acrobat PDFMaker
Adobe Acrobat
Adobe Bridge
After Effects
Animate
Character Animator
CommonFiles
Dreamweaver 2020
Dreamweaver CC 2019
Identity
Licensing
Photoshop
Prelude
Premiere Pro

感謝所有的幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM