Saturday, March 5, 2011

Why is "Run as different user" not available for some programs in Windows 7?

This blog post covers one of the reasons why holding down shift and right-clicking a shortcut might not give you the "Run as different user" option - only the "Run as administrator" option.

Duplicating the Problem
This is probably one of the most annoying "features" you'll ever encounter. It's probably also one of the least clear. Luckily there's a practically guaranteed way to duplicate the problem so you can see what I mean: install iTunes.

After you have installed the software if you hold down shift and right-click the installed icon you'll notice that you don't get the "Run as different user" option. Actually if you right click it and select "Pin to taskbar" and then run iTunes you'll also notice that it creates a "new" taskbar icon whereas you'd expect it to re-use the one you'd pinned there:

Duplicate iTunes Icons
If you right-click the icon and select "Properties" you'll also notice that the Shortcut itself seems to be setup in a "strange" way:

The "Target location" and "Start in" items appear to be blank.

Fixing the problem
Find the installation directory for the software you're trying to use. For iTunes this is either "C:\Program Files (x86)\iTunes" or "C:\Program Files\iTunes" depending on the OS you are running. If you look in this directory you will see a list of files:

The one we're intersted in I've highlighted - it's the main iTunes application (you can narrow it down for your application by looking for those files with a "Type" of Application and then doing each one in turn). Right-click this file and select "Create shortcut". You will then see the message that "Window's can't create a shortcut here" and "Do you want the shortcut to be placed on the desktop instead?". Click "Yes".

Hold down shift and right-click the new shortcut on your desktop and you'll see the "Run as different user" option is now available.