我有自己的python脚本,用于管理计算机上的IP地址。主要是在命令行(Windows 10)中执行netsh命令,该命令必须具有管理员权限。
I have my own python script that manages the IP address on my computer. Mainly it executes the netsh command in the command line (windows 10) which for you must have administrator rights.
这是我自己的计算机,我是管理员,运行时我已经使用管理员类型的用户(Adrian)登录了该脚本。
It is my own computer, I am the administrator and when running the script I am already logged in with my user (Adrian) which is of type administrator.
我无法使用右键单击并以管理员身份运行解决方案,因为我正在从python脚本执行netsh命令。
I can`t use the right click and "run as administrator" solution because I am executing my netsh command from my python script.
有人知道如何使用CMD的命令以管理员身份运行吗?
Anybody knows how to get "run as administrator" with a command from CMD ?
谢谢
推荐答案尝试如下操作: runas / user:administrator regedit 。
更多推荐
使用管理员权限打开cmd(Windows 10)
发布评论