Py2Exe:避免windows请求执行.exe文件的权限 [英] Py2Exe: avoid windows to request permission to execute .exe file

查看:234
本文介绍了Py2Exe:避免windows请求执行.exe文件的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个py2exe构建的程序,它直接从控制台(Windows Powershell)执行。涉及的模块是:xlrd和PrettyTable。



不幸的是,每次调用程序时,Windows都要求用户确认,因为程序需要特殊的权限。 p>

这是不可取的,因为脚本对于系统是安全的。它只是获取文本文件作为参数,并在同一文件夹中输出一个文本文件。我不希望用户被此权限请求吓到。



有没有办法避免这种行为?

解决方案

这可能是可能的;通常在较新版本的Windows中需要管理员或特权或特殊权限的可执行文件的原因是它修改了文件系统中的某些内容。由于您使用Excel文件模块,您可能访问的硬盘驱动器,这会使系统担心,因为它认为您的应用程序可能会混淆一些重要的事情。 (就像什么恶意软件,病毒和其他垃圾)但是,因为它没有安装任何可执行文件,这个Stackoverflow问题可能有你的答案:



(如果你有访问清单File)



堆栈溢出问题



否则,可能没有什么你能做的,因为Windows只是这样构建


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?

解决方案

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

这篇关于Py2Exe:避免windows请求执行.exe文件的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆