现在应该大部分人都使用win11系统吧,不用也要强行给你更新到win11,win11其实挺好用哈,只是有一点不好用,就是右键的菜单,今天做个小程序,就是应该修改win11的一个应用程序

先来看一段视频哈!

视频链接

windows11修改器

提取码:v9ms 源代码加编译后的文件

提取码:enr4 该程序的安装包 已被博主做成了安装包

这款软件纯python制作,内容简单

1、可以将win11的右键改为win10经典版,还可以进行恢复

2、可以去掉win11右键的终端(也就是win11的最高管理员窗口),win10可没有

3、可以修改桌面任务栏的最对齐或居中对齐

全面的三哥功能只能在win11里操作,win10没有任何效果,接下来的功能是可以在win10 和 win11 里进行操作的

这两个功能可以能对普通人没有太大的用哈,尤其是win10,

【添加记事本】最高对关于编程的人来说用的很多,有的时候看到不明文件就要右键用记事本打开看看,我就是这样哈,所以不知道代码的这个就不要操作了,因为会占你的右键菜单位置哈

【固定任务栏】这个对对于win10就没必要了,因为这个主要是添加应用程序到任务栏,可以快捷的操作,win10可以直接拖拽到任务栏已到达到固定的效果,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()

到此这篇关于基于Python制作简易的windows修改器的文章就介绍到这了,更多相关Python windows修改器内容请搜索Devmax以前的文章或继续浏览下面的相关文章希望大家以后多多支持Devmax!

基于Python制作简易的windows修改器的更多相关文章

  1. XCode 3.2 Ruby和Python模板

    在xcode3.2下,我的ObjectiveCPython/Ruby项目仍然可以打开更新和编译,但是你无法创建新项目.鉴于xcode3.2中缺少ruby和python的所有痕迹(即创建项目并添加新的ruby/python文件),是否有一种简单的方法可以再次安装模板?我发现了一些关于将它们复制到某个文件夹的信息,但我似乎无法让它工作,我怀疑文件夹的位置已经改变为3.2.解决方法3.2中的应用程序模板

  2. Swift基本使用-函数和闭包(三)

    声明函数和其他脚本语言有相似的地方,比较明显的地方是声明函数的关键字swift也出现了Python中的组元,可以通过一个组元返回多个值。传递可变参数,函数以数组的形式获取参数swift中函数可以嵌套,被嵌套的函数可以访问外部函数的变量。可以通过函数的潜逃来重构过长或者太复杂的函数。

  3. 10 个Python中Pip的使用技巧分享

    众所周知,pip 可以安装、更新、卸载 Python 的第三方库,非常方便。本文小编为大家总结了Python中Pip的使用技巧,需要的可以参考一下

  4. Swift、Go、Julia与R能否挑战 Python 的王者地位

    本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请发送邮件至dio@foxmail.com举报,一经查实,本站将立刻删除。

  5. 红薯因 Swift 重写开源中国失败,貌似欲改用 Python

    本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请发送邮件至dio@foxmail.com举报,一经查实,本站将立刻删除。

  6. 你没看错:Swift可以直接调用Python函数库

    上周Perfect又推出了新一轮服务器端Swift增强函数库:Perfect-Python。对,你没看错,在服务器端Swift其实可以轻松从其他语种的函数库中直接拿来调用,不需要修改任何内容。以如下python脚本为例:Perfect-Python可以用下列方法封装并调用以上函数,您所需要注意的仅仅是其函数名称以及参数。

  7. Swift中的列表解析

    在Swift中完成这个的最简单的方法是什么?我在寻找类似的东西:从Swift2.x开始,有一些与你的Python样式列表解析相当的东西。(在这个意义上,它更像是Python的xrange。如果你想保持集合懒惰一路通过,只是这样说:与Python中的列表解析语法不同,Swift中的这些操作遵循与其他操作相同的语法。

  8. swift抛出终端的python错误

    每当我尝试启动与python相关的swift时,我都会收到错误.我该如何解决?

  9. 在Android上用Java嵌入Python

    解决方法看看this,它适用于J2SE,你可以尝试在Android上运行.

  10. 在android studio中使用python代码构建android应用程序

    我有一些python代码和它的机器人,我正在寻找一种方法来使用android项目中的那些python代码.有没有办法做到这一点!?解决方法有两种主要工具可供使用,它们彼此不同:>QPython>Kivy使用Kivy,大致相同的代码也可以部署到IOS.

随机推荐

  1. 10 个Python中Pip的使用技巧分享

    众所周知,pip 可以安装、更新、卸载 Python 的第三方库,非常方便。本文小编为大家总结了Python中Pip的使用技巧,需要的可以参考一下

  2. python数学建模之三大模型与十大常用算法详情

    这篇文章主要介绍了python数学建模之三大模型与十大常用算法详情,文章围绕主题展开详细的内容介绍,具有一定的参考价值,感想取得小伙伴可以参考一下

  3. Python爬取奶茶店数据分析哪家最好喝以及性价比

    这篇文章主要介绍了用Python告诉你奶茶哪家最好喝性价比最高,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习吧

  4. 使用pyinstaller打包.exe文件的详细教程

    PyInstaller是一个跨平台的Python应用打包工具,能够把 Python 脚本及其所在的 Python 解释器打包成可执行文件,下面这篇文章主要给大家介绍了关于使用pyinstaller打包.exe文件的相关资料,需要的朋友可以参考下

  5. 基于Python实现射击小游戏的制作

    这篇文章主要介绍了如何利用Python制作一个自己专属的第一人称射击小游戏,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起动手试一试

  6. Python list append方法之给列表追加元素

    这篇文章主要介绍了Python list append方法如何给列表追加元素,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

  7. Pytest+Request+Allure+Jenkins实现接口自动化

    这篇文章介绍了Pytest+Request+Allure+Jenkins实现接口自动化的方法,文中通过示例代码介绍的非常详细。对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

  8. 利用python实现简单的情感分析实例教程

    商品评论挖掘、电影推荐、股市预测……情感分析大有用武之地,下面这篇文章主要给大家介绍了关于利用python实现简单的情感分析的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下

  9. 利用Python上传日志并监控告警的方法详解

    这篇文章将详细为大家介绍如何通过阿里云日志服务搭建一套通过Python上传日志、配置日志告警的监控服务,感兴趣的小伙伴可以了解一下

  10. Pycharm中运行程序在Python console中执行,不是直接Run问题

    这篇文章主要介绍了Pycharm中运行程序在Python console中执行,不是直接Run问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教

返回
顶部