from __future__ import print_function
import ctypes, sys, os def is_admin():
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False if is_admin():
os.startfile("system-jg_new.exe")
else:
if sys.version_info[0] == 3:
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
os.startfile("system-jg_new.exe")
else: # in python2.x
ctypes.windll.shell32.ShellExecuteW(None, u"runas", unicode(sys.executable), unicode(__file__), None, 1)
相关文章
- mac 获取管理员权限
- 华为荣耀笔记本电脑Windows Defender受IT管理员限制的解决办法
- windows 8 设置管理员权限
- Windows环境下Python 安装库 is not a supported wheel on this platform解决办法【转】
- C#获取管理员权限
- WINDOWS某些文件夹,提供管理员权限后也无法删除,正确解决办法
- tomcat 闪退的解决办法 Windows系统,找不到口令文件,必须限制口令文件读取访问权限
- Python Error fix-ERROR: Could not install packages due to an EnvironmentError: [Errno 13] 权限不够的解决办法
- Windows10系统提示 为了对电脑进行保护,已经阻止此应用(管理员已阻止你运行此应用。有关详细信息,请与管理员联系。)的解决办法
- 【转帖】在Windows 7下取得管理员权限并替换记事本为Notepad2 - Fred-Xu