0

I'm trying to run this code :

import subproccess

subproccess.call('netsh interface ip set dns "(Network Name)" static 8.8.8.8')

The problem is that code needed to be run with administrator permission so how can I do that?

Talha Tayyab
  • 8,111
  • 25
  • 27
  • 44
  • [This answer](https://stackoverflow.com/a/47385474/7519434) may be useful – Henry Mar 30 '22 at 18:47
  • I would suggest that to run it using a batch file then make a shortcut, enable it to run in administrator. Or compile it using nuitka or pyinstaller to have an exe then use run admin from that. If you're just running it through IDE then have it on admin mode as well. – Malcolm Who Mar 30 '22 at 21:20

0 Answers0