0

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

NourEldin Osama
  • 137
  • 3
  • 8

2 Answers2

1

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.

1

you cant get administrations privilege for security purpose

ahmed adel
  • 11
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 08 '22 at 05:09