NourEldin Osama
NourEldin Osama

Reputation: 157

The requested operation requires elevation (Run as administrator) python 3 - windows 10

I want to execute this command ("netsh wlan export profile folder=c:\ key=clear") in cmd via python 3 in windows 10 to get my wifi passwords so I create a script like that

import os
print(os.popen("netsh wlan export profile folder=c:\ key=clear").read())

but the code gives my this error The requested operation requires elevation (Run as administrator)

I want to make the script run as administrator

but I want to make it show a message From User Account Control that tells me

Do You Want To Allow This App To Make Changes To Your Device YES NO

but I want to do that Via Python Code

Upvotes: 0

Views: 1434

Answers (2)

ahmed adel
ahmed adel

Reputation: 11

you cant get administrations privilege for security purpose

Upvotes: 1

Michael Aarons
Michael Aarons

Reputation: 11

For one off runs set your bench to run as administrator. Say you use Pycharm. Then open Pycharm as administrator.

For other one offs make a shortcut to your command line and set the shortcut to use administrator.

Upvotes: 1

Related Questions