0

I have two user accounts. One is my regular account, the other one has administrative privileges throughout the domain. I log on with my regular account, and launch most programs. As my regular account has local administrative privileges, I am not prompted for credentials, only for approval.

Some programs we use demand that I run them as my domain admin, in order to run. Now, I know that I can simply hold shift down, right click the logo, and select "Run as another user". However, I want to be prompted for credentials, even if I forget to do so.

razumny
  • 728

1 Answers1

1

If you want to "run as admin" all the time, look at the last paragraph of this answer.

If you want to "run as different user" all the time, do this:

Make sure the program is a shortcut to the program. If it isn't, right click > New shortcut and choose the location of the original program.

When you have the shortcut, right click it > Properties > 'Shortcut' tab.

In the target field, cut or copy and delete everything.

Type: runas /user:DOMAIN\USER-NAME

for example - runas /user:superuser\razumny

and then paste the original target afterwards.

for example - runas /user:superuser\razumny "C:\Program Files\WinRAR\WinRAR.exe

Now, test it. It will ask to type in the password for superuser\razumny inside a command prompt. You will not see anything you type in, but it will be entering.

If you want to remember your credentials, type in /savecreds after your username.

For example - runas /user:superuser\razumny /savecreds "C:\Program Files\WinRAR\WinRAR.exe

This will only ask for your password the first time.

Test it again.

If you're happy, then you will need to change the shortcut image back to the original one - it will have been removed due to a new location used as the target. TO do this, Right click on the shortcut > properties > shortcut > Change Icon... and find the icon you want.

If you're just looking to run as administrator, then all you need to do is right click the shortcut > Properties > Compatibility > check the 'Run this program as Administrator' box.

ᔕᖺᘎᕊ
  • 6,253
  • This is an excellent answer to my question, and does everything I needed it to. Now, if I could stop kicking myself in the head for not thinking of this myself; I should have known this. – razumny May 05 '14 at 13:09
  • @razumny thanks. If you don't mind me asking, were you looking for running as admin all the time or different user. I wasn't really clear so I told you about both – ᔕᖺᘎᕊ May 05 '14 at 13:18
  • The app in question needs to be run by a user that, though it might not have administrative privileges on the computer the program is being run on, it must have privileges to access the underlying database. My regular user does not, while my admin user does. – razumny May 05 '14 at 14:30
  • 1
    TL;DR: Different user, not necessarily admin. – razumny May 05 '14 at 14:30