推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
rj2
V2EX  ›  Python

注册表编辑器怎么快速打开某个键

  •  
  •   rj2 · Jul 9, 2019 · 3586 views
    This topic created in 2682 days ago, the information mentioned may be changed or developed.
    请教,python 如何打开注册表编辑器。想获取软件所在注册表的位置,直接打开注册表所在的位置。
    15 replies  •  2019-11-29 16:41:31 +08:00
    rzti483NAJ66l669
    rzti483NAJ66l669
    Jul 9, 2019 via iPhone
    1
    你是要获取还是打开?
    loading
    loading
    Jul 9, 2019 via Android
    3
    regedit.exe 似乎没有这个参数,如果需要可能需要第三方注册表工具。
    rj2
    rj2
    OP
    Jul 10, 2019
    5
    @Humorce 获取这个键的路径后,直接打开。
    rj2
    rj2
    OP
    Jul 10, 2019
    6
    @ETiV 嗯。regjump.exe 这个也看到了,不太可用
    rzti483NAJ66l669
    rzti483NAJ66l669
    Jul 10, 2019
    7
    @rj2 #5

    1、kill regedit
    2、修改 HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit 下 LastKey 的值为指定路径
    3、start regedit

    参考:
    https://docs.python.org/3/library/winreg.html
    rj2
    rj2
    OP
    Jul 10, 2019
    8
    @Humorce 完美,谢了。
    rj2
    rj2
    OP
    Jul 11, 2019
    9
    @Humorce 今天试了下,这个思路是感觉是可以的,但是实际打开的是这样的。
    rzti483NAJ66l669
    rzti483NAJ66l669
    Jul 11, 2019
    10
    @rj2 #9

    没有看到图。
    rzti483NAJ66l669
    rzti483NAJ66l669
    Jul 11, 2019
    11
    @rj2 #9 忘挂梯子。

    应该是 LastKey 的值设置出现问题了。

    实现:
    https://imgur.com/a/z0IWYBb
    rj2
    rj2
    OP
    Jul 12, 2019❤️1
    12
    @Humorce
    #获取软件的 key 值
    KeyPath = self.numreg[1][key]['KeyPath']
    key_pa ="Software\Microsoft\Windows\CurrentVersion\Applets\Regedit"
    key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,key_pa,0, win32con.KEY_ALL_ACCESS)
    #给 Lastkey 的键添加键值
    win32api.RegSetValueEx(key,"LastKey",0,win32con.REG_SZ,KeyPath)
    os.system('regedit')

    查看了下赋值是正确的。打开就只是上面回复图。
    rj2
    rj2
    OP
    Jul 12, 2019
    13
    @Humorce 可以的,我手贱,代码忘记修改完。谢了。
    LEORChn
    LEORChn
    Nov 19, 2019
    14
    假设#12 那个位置是你想打开的,
    1.下载 http://www.nirsoft.net/ 的 RegScanner
    2.在文件菜单勾选 “支持 Reg:链接”
    3.CMD 输入 start reg:hkcu\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit

    注:它只能自动帮你选中 REGEDIT 左侧树形列表,第 3 步调用时勿带 [LastKey]
    LEORChn
    LEORChn
    Nov 29, 2019
    15
    然后,发现第 2 步可以跳过。
    第 3 步改为
    CMD 输入:regscanner.exe /regedit "hkcu\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit"
    一样的效果,只能输入 RegEdit 左侧树形列表的路径。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4051 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 03:52 · PVG 11:52 · LAX 19:52 · JFK 22:52
    ♥ Do have faith in what you're doing.