{"id":193,"date":"2008-10-15T02:52:39","date_gmt":"2008-10-15T02:52:39","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/andrewarnottms\/2008\/10\/15\/how-to-force-vista-to-not-elevate-an-application\/"},"modified":"2019-04-03T21:43:52","modified_gmt":"2019-04-04T04:43:52","slug":"how-to-force-vista-to-not-elevate-an-application","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/how-to-force-vista-to-not-elevate-an-application\/","title":{"rendered":"How to force Vista to NOT elevate an application"},"content":{"rendered":"<p>User Account Control, the feature in Vista that causes installers and some applications to require &quot;elevation&quot; to administrator privileges to run, cuts both ways.&#160; It&#8217;s designed to protect users from apps that try to make system-level changes by giving the user the heads up that it&#8217;s about to happen and gives the user the chance to abort the operation.&#160; The flip-side is that since this is an inconvenience to users, software writers are motivated to write their software so that it doesn&#8217;t require admin privileges, further improving security on the system.<\/p>\n<p>While there are problems with UAC, the most aggravating (for me) is that Vista insists on elevating some apps that don&#8217;t need elevation.&#160; For example, all setup.exe programs <em>always<\/em> elevate, since most users don&#8217;t want setup programs failing halfway through.&#160; Other programs, like regedit.exe, have manifests that say to Vista, in effect, &quot;I can run in user mode or admin mode, but give me admin mode if it&#8217;s available&quot;.&#160; So when a non-admin account launches regedit.exe, regedit comes up without requesting elevation.&#160; But if an admin account launches regedit, the UAC dialog comes up.&#160; Fair enough.&#160; <\/p>\n<p>But what if I <em>don&#8217;t want<\/em> to elevate an app that wants it?&#160; For example, if I didn&#8217;t want regedit.exe to have admin privileges to help protect me from myself when I only intended to modify HKEY_CURRENT_USER, which doesn&#8217;t require admin rights.&#160; <\/p>\n<p>But the more common scenario I find myself in is when I download software I do not entirely trust.&#160; The software comes with a setup program, which I have to run in order to use the software.&#160; I intend to install the program in a private user area rather than Program Files in order to avoid having to elevate the program or its setup program.&#160; But Vista always insists on elevating setup.exe programs.&#160; <\/p>\n<p>There <em>is<\/em> a way to coerce Vista to <em>not<\/em> elevate a process that it otherwise would.&#160; <\/p>\n<pre>REM The next command MUST be run from an elevated command window.\r\nREM It launches regedit.exe WITHOUT elevated privileges.\r\nrunas \/trustlevel:0x20000 regedit.exe<\/pre>\n<p>Ironically, starting a program explicitly without elevation requires an elevated command prompt.&#160; Go figure.<\/p>\n<p>So next time an untrusted program prompts for elevation that you don&#8217;t want to give, try this nifty command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>User Account Control, the feature in Vista that causes installers and some applications to require &quot;elevation&quot; to administrator privileges to run, cuts both ways.&#160; It&#8217;s designed to protect users from apps that try to make system-level changes by giving the user the heads up that it&#8217;s about to happen and gives the user the chance [&hellip;]<\/p>\n","protected":false},"author":2685,"featured_media":37840,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[4617],"class_list":["post-193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-permierdev","tag-andarno"],"acf":[],"blog_post_summary":"<p>User Account Control, the feature in Vista that causes installers and some applications to require &quot;elevation&quot; to administrator privileges to run, cuts both ways.&#160; It&#8217;s designed to protect users from apps that try to make system-level changes by giving the user the heads up that it&#8217;s about to happen and gives the user the chance [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/2685"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}