1

I want to run the command netsh interface set interface ethernet enabled

I have been trying but all attempts return 'execute as admin'.

import os

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

Tried to CD first to: C:\WINDOWS\system32> and then run the command, but nothing.

S. Wasta
  • 599
  • 9
  • 35
  • I tried to followed it but I don't really get it. I set `required_command = dir`, but password? is the 5 keys codes? Because it open cmd and 3-5 sec after it just close the cmd and does nothing – S. Wasta Nov 04 '20 at 18:09
  • I have no idea what "is the 5 keys codes" means. The answer with that example looks straightforward to use if you just copy/paste it, set `required_command` to your command, and set `required_password` to your account's password. What's confusing about that? – Random Davis Nov 04 '20 at 18:14
  • 5 keys codes, is the pin I set to login on Windows. I set the `required_command` and `required_password ` but it just write the password in python file, where my cursor is. Maybe have to update the code to current python version? which is 3.8 – S. Wasta Nov 04 '20 at 18:22
  • That answer is from 3 days ago so I'm sure it's up to date. Sounds like the script is automatically trying to type the password, but the password prompt isn't opening for some reason. You might need to mess around with that solution or try another one. – Random Davis Nov 04 '20 at 18:24

0 Answers0