Run a program as a different user in Windows 7
Whenever you open an application in Windows 7, it will automatically run "under your profile": this means that the program will use your credentials and user privileges, and that it will look for the documents in your "Documents" folder, save your settings under your "
%appdata%" roaming directory, etc. This all happens behind the scenes, because you nearly never have to worry about these details - the only case most of us come across having to change user profile is when a program needs to run with "administrative privileges", and you are not currently logged in as an administrator. But Windows 7 lets you launch any program as another user, so long as you can provide that user's credentials.
Run a program as an administrator (without switching profile)
Let's first start with a special case, how to an application under another profile without logging off, and run a program as an administrator, needed at times to edit system files, for example:
- Whether you are about to launch this program from the start menu or a shortcut on your desktop / in a folder in Windows Explorer, right-click on it instead of double-clicking as you normally do.
- Then, click on the "Run as administrator" option from the context menu that opened:
- Depending on your UAC settings, you may have to enter a password before Windows 7 executes the file.
If you are a "standard user" (how to change your type of user account), keep in mind that this program's settings will be saved under the default administrator account for which you have supplied credentials, since there can be more than one administrator on any Windows 7 PC. If you are already running as an administrator, that application will save its settings under your own profile.
Note that Windows 7 will only show the "Run as administrator" option for true executables (that is, files whose extension is "
.exe"). In some cases, like "
*.hta" files, the way around this limitation is to create a shortcut to that file, and make the shortcut launch with elevated privileges (through right-click > Properties), or creating a batch file that launches the application while itself running with administrative privileges.
Run a program as another user (administrator or standard user)
The principle is quite similar to launch an application under a different profile:
- When you see the program you want to launch, press the Shift key, and right-click on the program or program shortcut: the Shift key reveals additional options in the context menu.
- Now pick "Run as different user" from the context menu, and Windows 7 will open a "Windows Security" logon prompt dialog that lets you enter a new set of credentials:
- Enter the case-insensitive User name, and the case-sensitive Password in each text field, and click "OK" or hit Enter to temporarily logon under that user account.
- Tip: if you want to run a program with administrative privileges without using the default administrator's account, enter that other administrator's credentials. The procedure shown earlier in this tutorial doesn't give you that flexibility.
And this is all it takes to run that program under someone else's profile! Keep in mind that this application's privileges are those of the logon you provided, and this is where that program settings, if any, will be saved - another Windows 7 security feature will also prevent you (without some tricks on your part) from seeing files inside your own Desktop or Documents folders, but you can save anything you like under the Public folder for anyone to see and access.up ↑