John Lam 1997 — 2026

I really wish more devs would make the switch

Over the past few days, I’ve installed a couple of client applications that were clearly written by devs who run as local administrator on their computers. In both cases, these applications wrote to \Program Files\App Name\ directory. In both cases, they mistakenly thought that “they” owned that directory. And by “they”, I mean the guy who wrote the app thinks that they owned that directory, but that’s incorrect. In reality, the administrator who installed their application onto a user’s computer owns that directory. And once the user tries to run that application, bam! It blows up in their face.

There’s a whole bunch of areas on the computer that are off-limits to regular users, and for good reason. Among them are HKLM, \Windows, and \Program Files. Remember that keys like HKCR really map to HKLM\Software\Classes. It is really difficult for devs to build software that runs correctly under restricted accounts (like any account that belongs only to the Machine\Users group) unless they themselves run under such an account. So, please … make the switch!

There’s really nothing that I regularly do during development that I cannot accomplish by running under a regular user account. When I occasionally need to do some administrator-like things, I either temporarily create a new administrator command shell via the runas command, or I log out and log back in as admin to perform those tasks (setting ACL’s using Explorer is one of those tasks).

4 archived reader comments

Greg Reinacker (2003-02-11)

You know, I was one of the guilty ones with NewsGator until this last release. I usually run with admin privileges (I know, I should stop), but I had a test VM in which I would test things as a non-admin user. Well, I thought everything was working fine, until I read a post a few days ago where Ted Neward and Craig Andera were commenting how things didn’t work if you were non-admin. Heh…imagine my surprise when I realized my test VM didn’t have a NTFS file system! Pretty much anything goes, no matter who you are, with FAT32.

John Lam (2003-02-11)

Ouch!

Duncan Smart (2003-02-12)

Yes — in WinForms people should be made aware of these two in System.Windows.Forms: Application.UserAppDataPath and Application.UserAppDataRegistry Nice thing about them is that the folder/key is created on demand when youu access these properties.

Celexa (2004-10-25)

Check Celexa info.