快五一了,在这里祝大家五一快乐。顺便供上一块
点赞留一个关注!
现在大多数人都应该使用它win11系统,不用强行更新到win11,win11其实挺好用的,但是有一点不好用,就是右键菜单。今天做一个小程序应该修改win11应用程序
先看一段视频哈!
windows11修改器
这款软件纯python制作,内容简单
1、可以将win11的右键改为win10经典版也可以恢复
2、可以去掉win11右键终端(即11右键终端)win11最高管理员窗口)
,win10可没有
3.桌面任务栏的最对齐或中间对齐可以修改
三哥的综合功能只能在win11里操作,win10没有效果,下一个功能可以是win10 和 win11 内部操作
这两个功能对普通人来说可能不是很有用,尤其是win10,
最高用于编程的人很多。有时当你看到未知的文件时,你必须用记事本右键打开它。我就是这样。所以如果你不知道代码,不要操作它,因为它会占据你的右键菜单位置
这个对对于win10就没必要了,因为这个主要是添加应用程序到任务栏,可以快捷的操作,win可直接拖到任务栏达到固定效果,win11不一样,win11必须在菜单中固定到任务栏的右键文件,否则无法固定到任务栏
所以说,这个小程序就是为win11定制开发,win10没必要,但是可以收藏一下。你迟早会用的win11系统,以后可以用这个软件快速操作,遇到不会操作的同事也可以用这个软件安装。
废话不多说完整代码:
import tkinter from tkinter import * from tkinter.ttk import * from PIL import Image import win32api,win32con import os import wmi import subprocess def main(): root = Tk() root.title('剑工坊-Windongs-修改器') # 程序标题名称 root.geometry("480x320 512 288") # 窗口的大小和页面的显示位置 root.resizable(False, False) # 固定页面不能放大或缩小 root.iconbitmap("picture.ico") # 程序的图标 canvas = tkinter.Canvas(root, bg="#ebebeb", height=400, width=700, borderwidth=-3) # 创建画布 canvas.pack(side='top') # 放置画布(上端) canvas_4 = tkinter.Canvas(root, bg="#ebebeb", height=200, width=300, borderwidth=-2) canvas_4.place(x=-40, y=40) image_file_4 = tkinter.PhotoImage(file="./windwos10.png") # 加载图片文件 canvas_4.create_image(0, 0, anchor='nw', image=image_file_4) # 把图片放在画布上 def Label(): # 标签 tkinter.Label(canvas, bg="#ebebeb", fg='#8f8f8f', text='适配:win10、win11').place(x=350, y=290) w = wmi.WMI() for OS in w.Win32_OperatingSystem(): windwos = 'Windows 10' RR = OS.Caption # Microsoft Windows 10 家庭中文版 if RR.find(windwos) == 10: tkinter.Label(canvas, bg="#ebebeb",fg='#575757' ,text=当前版本:Windwos 10').place(x=10, y=290) else: windwos_2 = 'Windows 11' if RR.find(windwos_2) == 10: tkinter.Label(canvas, bg="#ebebeb",fg='#575757' , text=当前版本:Windwos 11').place(x=10, y=290) else: tkinter.Label(canvas, bg="#ebebeb",fg='#575757' , text=没有检测到系统版本!!').place(x=10, y=290) Label() # windwos 标志 canvas_3 = tkinter.Canvas(root, bg="#ebebeb", height=50, width=480, borderwidth=-2) canvas_3.place(x=0, y=0) image_file_3 = tkinter.PhotoImage(file="./windows.png") # 加载图片文件 canvas_3.create_image(0, 0, anchor='nw', image=image_file_3) # 把图片放在画布上 # 放置二维码 canvas_2 = tkinter.Canvas(root, bg="red", height=80, width=200, borderwidth=-2) canvas_2.place(x=250, y=50) image_file_2 = tkinter.PhotoImage(file="./share.png") # 加载图片文件 canvas_2.create_image(0, 0, anchor='nw', image=image_file_2) # 把图片放在画布上 def Align_left(): # 左对齐 subprocess.Popen("reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v TaskbarAl /t REG_DWORD /d 0 /f", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) def Right_align(): # 居中对齐 subprocess.Popen("reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v TaskbarAl /t REG_DWORD /d 1 /f", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) def Right_click_Add(): # 右键添加 记事本打开 subprocess.Popen( "reg add HKEY_CLASSES_ROOT\*\shell\打开记事本 /v HasLUAShield /f", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) subprocess.Popen( "reg add HKEY_CLASSES_ROOT\*\shell\用记事本打开 /v ICON /d C:/windows/system32/notepad.exe /f", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) subprocess.Popen( "reg add HKEY_CLASSES_ROOT\*\shell\打开记事本 /v SeparatorBefore /d \ /f", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen(
"reg add HKEY_CLASSES_ROOT\*\shell\用记事本打开 /v SeparatorAfter /d \ /f",
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen(
"reg add HKEY_CLASSES_ROOT\*\shell\用记事本打开 /v Position /d Center /f",
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen(
'reg add HKEY_CLASSES_ROOT\*\shell\用记事本打开\command /d "notepad.exe ""%1""" /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def Fixed_taskbar(): # 固定到任务栏
subprocess.Popen(
'reg add HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\{90AA3A4E-1CBA-4233-B8BB-535773D48449} /d "Taskband Pin" /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def Windows_Terminal(): # 去除右键(Open in Windows Terminal)项
subprocess.Popen(
'reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" /v {9F156763-7844-4DC4-B2B1-901F640F5155} /d "Windows Terminal" /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def default_Windows_Terminal(): # 恢复右键(Open in Windows Terminal)项
subprocess.Popen(
'reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" /v {9F156763-7844-4DC4-B2B1-901F640F5155} /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def Old_right_button(): # 右键改为win10
subprocess.Popen( # 恢复右键(Open in Windows Terminal)项
'reg add HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32 /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
T = win32api.MessageBox(0, "刷新后即可显现 是否刷新", "安全窗口", win32con.MB_YESNO)
if T == 6: # 6表示是
subprocess.Popen( # 恢复右键(Open in Windows Terminal)项
'sihost.exe',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def New_right_button(): # 右键改为win11
subprocess.Popen( # 恢复右键(Open in Windows Terminal)项
'reg delete HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2} /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
T = win32api.MessageBox(0, "刷新后即可显现 是否刷新", "安全窗口", win32con.MB_YESNO)
if T == 6: # 6表示是
subprocess.Popen( # 恢复右键(Open in Windows Terminal)项
'sihost.exe',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def default_fiel(): # 恢复默认
subprocess.Popen( # 恢复记事本
'reg delete HKEY_CLASSES_ROOT\*\shell\用记事本打开 /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen( # 恢复固定到任务栏
'reg delete HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\{90AA3A4E-1CBA-4233-B8BB-535773D48449} /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen( # 恢复右键(Open in Windows Terminal)项
'reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" /v {9F156763-7844-4DC4-B2B1-901F640F5155} /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Right_align() # 任务栏居中
New_right_button() # 右键改为win11
T = win32api.MessageBox(0, "刷新后即可恢复 是否刷新", "安全窗口", win32con.MB_YESNO)
if T == 6: # 6表示是
subprocess.Popen( # 恢复右键(Open in Windows Terminal)项
'sihost.exe',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Button(root, text='任务栏左对齐',width=14, command=Align_left).place(x=238, y=130)
Button(root, text='任务栏居中对齐',width=14, command=Right_align).place(x=356, y=130)
Button(root, text='右键添加(用记事本打开)',width=31, command=Right_click_Add).place(x=238, y=160)
Button(root, text='右键添加(固定任务栏)',width=31, command=Fixed_taskbar).place(x=238, y=190)
Button(root, text='去除右键的(Open in Windows Terminal)项', width=44, command=Windows_Terminal).place(x=90, y=220)
Button(root, text='右键改为经典win10',width=44, command=Old_right_button).place(x=90, y=250)
Button(root, text='恢复\n 全\n默认', width=7, command=default_fiel).place(x=410, y=220)
Button(root, text='恢复终端', width=10, command=default_Windows_Terminal).place(x=10, y=220)
Button(root, text='恢复win11', width=10, command=New_right_button).place(x=10, y=250)
root.mainloop() #运行
if __name__ == '__main__':
main()