如何使用ShellExcute方法避免Vista机器上的UAC杂讯 [英] how to avoid UAC messgae on vista machine using ShellExcute method

查看:108
本文介绍了如何使用ShellExcute方法避免Vista机器上的UAC杂讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我创建了一个小型MFC应用程序.通过在服务器上运行EXE文件来更新MFC应用程序(例如\\ Server1 \ ITDept \ MyEXEPatcher.exe)

当我使用ShellExecute()在服务器上打开该文件时,Vista和7会提示UAC,这通常会延迟或阻止EXE更新. (人们看不到UAC,忽略它,阻止它或离开他们的办公桌).


我已经注意到Adobe Reader,Advance Installer和其他程序通过Internet在没有UAC的情况下更新了自己的EXE,如何通过服务器地址来执行相同的操作?

我可以使用WinSock并假装服务器文件在网络上吗?

我可以创建一个在后台检查和更新本地EXE的服务吗?

如果我只是简单地将EXE文件从该服务器路径复制到本地文件夹,然后在本地执行ShellExecute,是否可以避免UAC?

谢谢

Hi,


I have created a small MFC app.The MFC app gets updated by running an EXE file on a server (for example \\Server1\ITDept\MyEXEPatcher.exe)

When I use ShellExecute() to open that file on the Server, Vista and 7 prompt the UAC, which often delays or blocks the EXE update. (people dont see the UAC, ignore it, block it, or are away from their desk).


I''ve noticed Adobe reader,Advance Installer and other programs update their own EXE over the Internet without UAC, how can I do the same but from a Server Address?

Can I use WinSock and pretend the server file is on the web?

Can I create a Service that checks and updates the local EXE in the background?

If I simply copy the EXE file from that server path to a local folder then ShellExecute it locally, would that avoid UAC?

Thanks

推荐答案

您可以关闭UAC,也可以以管理员身份运行该应用程序.我认为为了以管理员身份运行该应用程序,您不能使用ShellExecute.相反,创建一个进程并设置适当的属性以使其以admin身份运行.
You can either turn off the UAC, or run the app as admin. I think in order to run the app as admin, you can''t use ShellExecute. Instead, create a process and set the appropriate properties to run it as admin.


这篇关于如何使用ShellExcute方法避免Vista机器上的UAC杂讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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