如何在UAC提示中禁用命令行参数 [英] How to disable command line arguments in UAC prompt

查看:188
本文介绍了如何在UAC提示中禁用命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用shellexecute()将命令行参数从一个进程传递到另一个进程.
在Windows 7中,我收到一个UAC提示符,在该提示符下可以看到这些命令行参数,但是我不希望看到这些参数.

我正在以管理员身份运行.

例如:
这是我的示例代码.

Hi everyone,
I am passing command line arguments from one process to another process using shellexecute().
In windows 7 i am getting a UAC prompt, in that prompt these command line arguments are seen,but i dont want these arguments to be seen.

I am running this as run as administrator.

example:
This is my sample code.

HINSTANCE hi = ShellExecute(NULL,_T("open"),path of exe to be invoked,commandline argumets to be passed,NULL,SW_SHOW);

推荐答案

您需要嵌入清单文件,该文件指示您的应用程序需要管理访问权限.

这是描述细节的链接:

http://blogs.msdn. com/b/heaths/archive/2006/09/26/custom-actions-under-uac-in-vista.aspx [
You need to embed a manifest file that indicates your application needs administrative access.

Here is a link that describes the details:

http://blogs.msdn.com/b/heaths/archive/2006/09/26/custom-actions-under-uac-in-vista.aspx[^]

When your second application is started by an application that already has elevated privileges, the prompt will not appear.


如果是您的应用程序,则可以添加一些内部选项处理. />
如果启动外部程序,则UAC会按设计工作.很好.

猜猜你在做一些坏事吗?
if it is you app your starting you can add some internal handling of options.

If you start an external programm that UAC works as designed. And very fine.

Guess that you are doing some bad stuff?


这篇关于如何在UAC提示中禁用命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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