基于Python制作簡(jiǎn)易的windows修改器
現(xiàn)在應(yīng)該大部分人都使用win11系統(tǒng)吧,不用也要強(qiáng)行給你更新到win11,win11其實(shí)挺好用哈,只是有一點(diǎn)不好用,就是右鍵的菜單,今天做個(gè)小程序,就是應(yīng)該修改win11的一個(gè)應(yīng)用程序
先來(lái)看一段視頻哈!
windows11修改器

這款軟件純python制作,內(nèi)容簡(jiǎn)單
1、可以將win11的右鍵改為win10經(jīng)典版,還可以進(jìn)行恢復(fù)

2、可以去掉win11右鍵的終端(也就是win11的最高管理員窗口),win10可沒(méi)有

3、可以修改桌面任務(wù)欄的最對(duì)齊或居中對(duì)齊

全面的三哥功能只能在win11里操作,win10沒(méi)有任何效果,接下來(lái)的功能是可以在win10 和 win11 里進(jìn)行操作的
這兩個(gè)功能可以能對(duì)普通人沒(méi)有太大的用哈,尤其是win10,
【添加記事本】最高對(duì)關(guān)于編程的人來(lái)說(shuō)用的很多,有的時(shí)候看到不明文件就要右鍵用記事本打開(kāi)看看,我就是這樣哈,所以不知道代碼的這個(gè)就不要操作了,因?yàn)闀?huì)占你的右鍵菜單位置哈
【固定任務(wù)欄】這個(gè)對(duì)對(duì)于win10就沒(méi)必要了,因?yàn)檫@個(gè)主要是添加應(yīng)用程序到任務(wù)欄,可以快捷的操作,win10可以直接拖拽到任務(wù)欄已到達(dá)到固定的效果,win11就不一樣了,win11這個(gè)必須要右鍵文件在菜單里找到固定到任務(wù)欄,否則是沒(méi)有辦法固定到任務(wù)欄的
所以說(shuō),這個(gè)小程序就是為win11定制開(kāi)發(fā)的,win10沒(méi)必要,但是可以收藏一下,你們?cè)缤硪玫絯in11系統(tǒng),以后可以用這個(gè)軟件快捷操作嘛,如果遇到同事不會(huì)操作也可以用這個(gè)軟件裝一下。

廢話(huà)不多說(shuō) 完整代碼:
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-修改器') # 程序的標(biāo)題名稱(chēng)
root.geometry("480x320+512+288") # 窗口的大小及頁(yè)面的顯示位置
root.resizable(False, False) # 固定頁(yè)面不可放大縮小
root.iconbitmap("picture.ico") # 程序的圖標(biāo)
canvas = tkinter.Canvas(root, bg="#ebebeb", height=400, width=700, borderwidth=-3) # 創(chuàng)建畫(huà)布
canvas.pack(side='top') # 放置畫(huà)布(為上端)
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) # 將圖片置于畫(huà)布上
def Label():
# 標(biāo)簽
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='當(dāng)前版本: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='當(dāng)前版本:Windwos 11').place(x=10, y=290)
else:
tkinter.Label(canvas, bg="#ebebeb",fg='#575757' , text='未檢測(cè)出系統(tǒng)版本!!').place(x=10, y=290)
Label()
# windwos 標(biāo)志
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) # 將圖片置于畫(huà)布上
# 放置二維碼
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) # 將圖片置于畫(huà)布上
def Align_left(): # 左對(duì)齊
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(): # 居中對(duì)齊
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(): # 右鍵添加 記事本打開(kāi)
subprocess.Popen(
"reg add HKEY_CLASSES_ROOT\*\shell\用記事本打開(kāi) /v HasLUAShield /f",
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen(
"reg add HKEY_CLASSES_ROOT\*\shell\用記事本打開(kāi) /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\用記事本打開(kāi) /v SeparatorBefore /d \ /f",
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen(
"reg add HKEY_CLASSES_ROOT\*\shell\用記事本打開(kāi) /v SeparatorAfter /d \ /f",
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen(
"reg add HKEY_CLASSES_ROOT\*\shell\用記事本打開(kāi) /v Position /d Center /f",
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen(
'reg add HKEY_CLASSES_ROOT\*\shell\用記事本打開(kāi)\command /d "notepad.exe ""%1""" /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def Fixed_taskbar(): # 固定到任務(wù)欄
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)項(xiàng)
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(): # 恢復(fù)右鍵(Open in Windows Terminal)項(xiàng)
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( # 恢復(fù)右鍵(Open in Windows Terminal)項(xiàng)
'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, "刷新后即可顯現(xiàn) 是否刷新", "安全窗口", win32con.MB_YESNO)
if T == 6: # 6表示是
subprocess.Popen( # 恢復(fù)右鍵(Open in Windows Terminal)項(xiàng)
'sihost.exe',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def New_right_button(): # 右鍵改為win11
subprocess.Popen( # 恢復(fù)右鍵(Open in Windows Terminal)項(xiàng)
'reg delete HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2} /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
T = win32api.MessageBox(0, "刷新后即可顯現(xiàn) 是否刷新", "安全窗口", win32con.MB_YESNO)
if T == 6: # 6表示是
subprocess.Popen( # 恢復(fù)右鍵(Open in Windows Terminal)項(xiàng)
'sihost.exe',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def default_fiel(): # 恢復(fù)默認(rèn)
subprocess.Popen( # 恢復(fù)記事本
'reg delete HKEY_CLASSES_ROOT\*\shell\用記事本打開(kāi) /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen( # 恢復(fù)固定到任務(wù)欄
'reg delete HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\{90AA3A4E-1CBA-4233-B8BB-535773D48449} /f',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.Popen( # 恢復(fù)右鍵(Open in Windows Terminal)項(xiàng)
'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() # 任務(wù)欄居中
New_right_button() # 右鍵改為win11
T = win32api.MessageBox(0, "刷新后即可恢復(fù) 是否刷新", "安全窗口", win32con.MB_YESNO)
if T == 6: # 6表示是
subprocess.Popen( # 恢復(fù)右鍵(Open in Windows Terminal)項(xiàng)
'sihost.exe',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Button(root, text='任務(wù)欄左對(duì)齊',width=14, command=Align_left).place(x=238, y=130)
Button(root, text='任務(wù)欄居中對(duì)齊',width=14, command=Right_align).place(x=356, y=130)
Button(root, text='右鍵添加(用記事本打開(kāi))',width=31, command=Right_click_Add).place(x=238, y=160)
Button(root, text='右鍵添加(固定任務(wù)欄)',width=31, command=Fixed_taskbar).place(x=238, y=190)
Button(root, text='去除右鍵的(Open in Windows Terminal)項(xiàng)', width=44, command=Windows_Terminal).place(x=90, y=220)
Button(root, text='右鍵改為經(jīng)典win10',width=44, command=Old_right_button).place(x=90, y=250)
Button(root, text='恢復(fù)\n 全\n默認(rèn)', width=7, command=default_fiel).place(x=410, y=220)
Button(root, text='恢復(fù)終端', width=10, command=default_Windows_Terminal).place(x=10, y=220)
Button(root, text='恢復(fù)win11', width=10, command=New_right_button).place(x=10, y=250)
root.mainloop() #運(yùn)行
if __name__ == '__main__':
main()到此這篇關(guān)于基于Python制作簡(jiǎn)易的windows修改器的文章就介紹到這了,更多相關(guān)Python windows修改器內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Python爬蟲(chóng)分析微博熱搜關(guān)鍵詞的實(shí)現(xiàn)代碼
這篇文章主要介紹了Python爬蟲(chóng)分析微博熱搜關(guān)鍵詞的實(shí)現(xiàn)代碼,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-02-02
python實(shí)現(xiàn)簡(jiǎn)單的計(jì)時(shí)器功能函數(shù)
這篇文章主要介紹了python實(shí)現(xiàn)簡(jiǎn)單的計(jì)時(shí)器功能函數(shù),涉及Python操作時(shí)間的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03
python讀取excel數(shù)據(jù)繪制簡(jiǎn)單曲線(xiàn)圖的完整步驟記錄
這篇文章主要給大家介紹了關(guān)于python讀取excel數(shù)據(jù)繪制簡(jiǎn)單曲線(xiàn)圖的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-10-10
Python腳本實(shí)現(xiàn)Zabbix多行日志監(jiān)控過(guò)程解析
這篇文章主要介紹了Python腳本實(shí)現(xiàn)Zabbix多行日志監(jiān)控過(guò)程解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-08-08
Python 中由 yield 實(shí)現(xiàn)異步操作
這篇文章主要介紹了Python 中由 yield 實(shí)現(xiàn)異步操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-05-05
Python?Serial串口的簡(jiǎn)單數(shù)據(jù)收發(fā)方式
這篇文章主要介紹了Python?Serial串口的簡(jiǎn)單數(shù)據(jù)收發(fā)方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-09-09
python計(jì)算寄送包裹重量的實(shí)現(xiàn)過(guò)程
要實(shí)現(xiàn)這樣一個(gè)需求寄送包裹小于5kg,每公斤0.5元,大于等于5kg,超出5公斤部分,按照每公斤0.8元計(jì)算,輸入重量,輸出應(yīng)付金額,下面小編給大家分享實(shí)現(xiàn)代碼,感興趣的朋友跟隨小編一起看看吧2022-02-02
anaconda安裝后打不開(kāi)解決方式(親測(cè)有效)
Anaconda是一個(gè)和Canopy類(lèi)似的科學(xué)計(jì)算環(huán)境,但用起來(lái)更加方便,下面這篇文章主要給大家介紹了關(guān)于anaconda安裝后打不開(kāi)解決的相關(guān)資料,文中通過(guò)圖文介紹的非常詳細(xì),需要的朋友可以參考下2022-09-09

