开发者

Visual Studio 2005 C++ Application Wants To Run As Admin

开发者 https://www.devze.com 2022-12-29 18:44 出处:网络
I wrote a simple c++ application in Visual Studio 2005 but when I compile it, the executable wants to run as admin. I tried deleting the manifest but it still wants to run as admin. I am run开发者_开发

I wrote a simple c++ application in Visual Studio 2005 but when I compile it, the executable wants to run as admin. I tried deleting the manifest but it still wants to run as admin. I am run开发者_开发问答ning Windows Vista Home premium. Any help would be appreciated!


Windows will ask you for the administrator password if the name of your executable "looks like" a name of a setup program. Name you executable setup.exe and you will be prompted for password every time you run it. What is the name of your executable?


To prevent these heuristics from guessing for you, put a manifest on your application. From Visual Studio 2005 it is harder than from Visual Studio 2008. I have instructions at http://www.gregcons.com/KateBlog/AddingAManifestToAVistaApplication.aspx that elaborate on those at http://blogs.msdn.com/cheller/archive/2006/08/24/how-to-embed-a-manifest-in-an-assembly-let-me-count-the-ways.aspx - these are for VS 2005, for C#, VB, and C++. If your app has an asInvoker manifest it will no longer elevate even if it's named Setup.exe or Patch.exe.

0

精彩评论

暂无评论...
验证码 换一张
取 消