Monday, September 24, 2007

Replacing Notepad on Windows Vista with UAC Enabled

One of the first things I do after setting up a new Windows machine is replace the built-in notepad application. My favorite replacement is the lightweight and free Notepad2 by Florian Balmer. In Windows XP it's basically a matter of replacing all the copies of the notepad.exe file and ignoring the Windows File Protection prompt to "fix" the situation. I have even created a simple installer to do the grunt work for me.

In Windows Vista, however, it's not so easy. The file replacement works as expected but every time Notepad2 starts Windows shows the Security Warning: "The publisher could not be verified. Are you sure you want to run this software?" In Windows XP you can simply unchecked the option to "Always ask before opening this file", or click the Unblock button in one of the executable's property pages. However, the combination of Vista's User Account Control (UAC) and IE7's Persistent Zone Identifier makes this impossible from the standard GUI. Neither of these changes remains permanent, and the next time you start Notepad2 the warning is displayed agin. Needles to say, this gets bothersome very quickly if you're like me and are trying to avoid turning off UAC altogether.

Recently I found this post on how to use a cool little utility called runmenu to display an executable's property page with elevated rights. Using the same method I was able to unblock Notepad2 permanently and now I'm no longer bothered with the anoying warnings.

2008-02-01: UPDATE: I have found another issue with replacing the original notepad.exe - recently I have had to take ownership of the original file and then grant the local Administrators group full control before being able to replace the notepad.exe file. It seems that only the TrustedInstaller account has these rights by default. I don't remember having to do this the first few times so it may mean there has been a security change in one of the updates..