Python在Windows上以管理员身份运行命令

时间:2020-11-04 18:04:05

标签: python windows shell

我要运行命令 netsh interface set interface ethernet enabled

我一直在尝试,但是所有尝试都返回“以管理员身份执行”。

import os

os.system('cmd /c netsh interface set interface ethernet enabled')

首先尝试CD:C:\WINDOWS\system32>,然后运行命令,但是什么也没有。

0 个答案:

没有答案