December 2006

The Case of the Notepad that Wouldn't Run


RSS
Subscribe to Windows IT Pro | See More Permissions Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
Main Article    Ask the Experts

I recently presented a class to Microsoft developers that included a section about Windows Vista's User Account Control (UAC) feature. UAC allows users, even administrators, to run as standard users most of the time, while giving them the ability to run executables with administrator rights when necessary. The following list shows the situations in which executables can trigger a request for administrator rights:

  • If the executable image includes a Vista manifest file that specifies a desire or need for administrator rights.
  • If the executable is in Vista's application compatibility database as a legacy application that Microsoft has identified as requiring administrator rights to run correctly.
  • If the user explicitly requests an elevation using Windows Explorer's Run as administrator menu item in the context menu for executables.
  • If the executable is determined to be a setup or installer program (e.g., if the word "setup" or "update" is in the image's name).

Perhaps the most common need for administrator rights comes from setup programs, which generally can't install properly without write access to HKEY_LOCAL_MACHINE\Software and HKEY_LOCAL_MACHINE\Program Files—two registry locations that only administrators can modify. As an ad hoc demonstration of this, during the presentation I copied \Windows\Notepad.exe to my account's profile directory, renaming it to Notepad-setup.exe in the process. Then I launched it, expecting to see a consent dialog box asking me to grant the renamed Notepad administrative rights. To my consternation, no such dialog appeared. In fact, nothing happened, even when I tried again.

You can follow all the steps I performed to diagnose the Notepad startup problem by visiting my blog at https://blogs.technet.com/markrussinovich/archive/2006/10.aspx. In a nutshell, the reason I hadn't been presented with a UAC consent dialog box asking me to give it permission to run with administrator rights is that heuristic setup detection applies only to files that don't have an embedded manifest that specifies a security TrustLevel. Notepad does include a manifest and therefore doesn't trigger the UAC consent dialog box. The reason Notepad didn't execute is that in Vista, executables can have external resource files, and Notepad looks for its resource files in subdirectories beneath it. Because I didn't copy the resource files, Notepad couldn't find them and silently exited.

This is a summary of a popular posting to Mark Russinovich’s technical blog (https://blogs.technet.com/markrussinovich/about.aspx), which covers topics such as Windows troubleshooting, technologies, and security. You can read the entire post at https://blogs.technet.com/markrussinovich/archive/2006/10.aspx.

End of Article



Windows IT Pro Community
Blogs





Top Viewed ArticlesView all articles
PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

Microsoft Delivers Service Pack 2 Beta 2 for Vista, Server 2008

Microsoft on Tuesday announced the availability of the Beta 2 version of Service Pack 2 (SP2) for Windows Vista and Windows Server 2008. Since both operating systems were developed from the same code base, they have a common servicing structure and thus ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events How IE7 & The New Extended Validation SSL Certificates Impact Your Site

Securely Extend SharePoint to the Extranet

Configuration Manager SP1 and R2 Overview

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


SQL Server Magazine Office & SharePoint Pro Windows Dev Pro ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing