Search code examples
windowspowershellconsolepy2exeprivileges

Py2Exe: avoid windows to request permission to execute .exe file


I have a py2exe-built program which is executed directly from the console (Windows Powershell). Involved modules are: xlrd and PrettyTable.

Unfortunately, each time the program is called, Windows asks the user for a confirmation, as the program would need particular privileges.

This is undesirable as the script is "safe" for the system. It just gets text files as arguments and outputs a text file, in the same folder. I don't want the user to be scared by this permission request.

Is there any way to avoid such behaviour?


Solution

  • It may be possible; usually the reason for an executable requiring admininstrator or privileges or special permissions in newer versions of Windows is that it modifies something in your file system. Since your using an Excel File Module, your are probably accessing the hard drive, which worries the system because it thinks your application might mess with something important. (Like what malware, viruses and other junk does) But since its not installing anything executable, this Stackoverflow question might have your answer:

    (if you have access to a Manifest File)

    Stack Overflow Question

    Otherwise, there might be nothing you can do about it, as Windows is just built that way