import winreg
def get_reg():
try:
key1=winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice",0, winreg.KEY_SET_VALUE)
key2 = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
r"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice",0, winreg.KEY_SET_VALUE)
try:
# ProgId,type = winreg.QueryValueEx(key1, 'ProgId')
# print('type is ', type)
# print('ProgId is ',ProgId)
# Hash, type = winreg.QueryValueEx(key1, 'Hash')
#
# print('type is ',type)
# print('Hash is ',Hash)
browser = 'MSEdgeHTM'
hashid1 = 'A1wPMavwB3E='
hashid2 = 'qG3RGysP8BY='
winreg.SetValueEx(key1, 'ProgId', 1, winreg.REG_SZ, browser)
winreg.SetValueEx(key2, 'ProgId', 1, w

使用Python脚本修改Windows 10系统的默认浏览器为Edge,通过winreg模块操作注册表实现。
最低0.47元/天 解锁文章
6334

被折叠的 条评论
为什么被折叠?



