1

I have a code that include a line requires admin permission to run.

with pydivert.WinDivert("(tcp.DstPort==80 ) and tcp.PayloadLength >0 ") as w:

When I run the script in cmd without admin rights, I get the next error:

PermissionError: [WinError 5] Access is denied." 

When I run the script in cmd that opend by "run as administrator", its working.

The problem start when I try to convert this script to exe file by pyinstaller. The code inside the exe file Requires the admin permissions. How can I solve it?

double-beep
  • 5,031
  • 17
  • 33
  • 41
Meitarb12
  • 51
  • 1
  • 1
  • 4
  • Does this answer your question? [How to run python script with elevated privilege on windows](https://stackoverflow.com/questions/19672352/how-to-run-python-script-with-elevated-privilege-on-windows) – dspencer Mar 26 '20 at 04:09

1 Answers1

0

Have you tried running the executable as an administrator?

Some programs will let you convert scripts into admin-only executables, but I'm not sure this would help you here. Like I said, try running the EXE as administrator.