将命令行参数隐藏到EXE [英] Hide command line parameters to an EXE

查看:167
本文介绍了将命令行参数隐藏到EXE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在调用Windows C#从我的主应用程序(C#)开发EXE来注册主应用程序。 (需要另外一个EXE,因为它需要提升权限)

并且,为了避免它直接由客户打开,我将作为命令行参数向exe发送密码。

但问题是,当UAC消息显示提升权限时,它会显示整个路径以及我发送的密码,我该如何避免这种情况,请帮助我谢谢

Hi,

I am calling a windows C# developed EXE from my main application (C#) to register the main application. (Needed to make another EXE since it needs elevated privileges)
And, for avoiding it to open directly by the customer, I am sending a password to the exe as command line argument.
But the problem is that, When UAC messages shows for elevated privilege, It shows the whole path along with the password I sent, How can I avoid this, Please help me thanks

推荐答案

坏主意,带有额外可执行文件的那个。通常,如果您将某个* .EXE用于其他目的,然后让用户启动应用程序,这已经是错误架构的标志。至少它可以从* .EXE重命名为其他东西(它不会改变它的功能),但这不是一个真正的解决方案...



你可以自动请求通过添加和嵌入适当的应用程序清单来提升权限。这在这里解释:

http://msdn.microsoft.com/en -us / library / bb756929.aspx [ ^ ]。



当然,你不能绕过UAC(它会破坏它的目的),但你可以关掉它,我强烈反对。



-SA
Bad idea, the one with extra executable. Generally, if you are using some *.EXE for the purpose other then letting the user to start an application, this is already a sign of wrong architecture. At least it could be renamed from *.EXE to something else (it would not change its functionality), but this is not a real solution…

You can automatically request elevated privileges by adding and embedding appropriate application manifest. This is explained here:
http://msdn.microsoft.com/en-us/library/bb756929.aspx[^].

Of course, you cannot bypass UAC (it would defeat its purpose), but you can switch it off, which I would strongly discourage.

—SA


这篇关于将命令行参数隐藏到EXE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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