locked
Using "Run as different user" RRS feed

  • Question

  • Is there a way to make a shortcut to a program so that it will prompt you for credentials every time. I know if you hold down Shift and right click you can get the Run as different user (which is what I want). I just want to save a step because I use the program all the time, but need domain credentials to make any changes. AD, GP Managment etc...

    Windows XP had the functionality by setting the advanced properties of the shortcut to Run with different credentials. Windows 7 only has run as administrator in the advanced shortcut properties., which doesn't work because its local admin not domain admin.

    Does anyone know how to do this?

    Tuesday, December 1, 2009 6:33 PM

Answers

  • Hi

    Actually, this command was completely removed in Windows Vista and was added back to the Windows 7 extended right click context menu.  :))

    You can use the same 'fix' that was used in Vista. Go to the following Microsoft website and download the ShellRunas utility.

    Sysinternals - ShellRunas

    Unzip the file and place a copy of ShellRunas.exe in the C:\Windows\System32 folder.

    Create a shortcut to the executable that you want to run as a different user.

    Right click the shortcut and select Properties.

    Place the following command at the beginning of the Target line so that the command looks like this.

    C:\Windows\System32\ShellRunas.exe <path to shortcut target>

    (Be sure to include the space after shellrunas.exe)

    You can also add the Run As Different User to the normal right click context menu.

    Open an elevated command prompt and enter the following command.

    shellrunas /reg

    Press ENTER.

    Hope this helps.

    Thank You for using Windows 7

    Ronnie Vernon MVP

    • Marked as answer by Tyrel_F Tuesday, December 1, 2009 9:11 PM
    Tuesday, December 1, 2009 7:44 PM

All replies

  • Hi

    Actually, this command was completely removed in Windows Vista and was added back to the Windows 7 extended right click context menu.  :))

    You can use the same 'fix' that was used in Vista. Go to the following Microsoft website and download the ShellRunas utility.

    Sysinternals - ShellRunas

    Unzip the file and place a copy of ShellRunas.exe in the C:\Windows\System32 folder.

    Create a shortcut to the executable that you want to run as a different user.

    Right click the shortcut and select Properties.

    Place the following command at the beginning of the Target line so that the command looks like this.

    C:\Windows\System32\ShellRunas.exe <path to shortcut target>

    (Be sure to include the space after shellrunas.exe)

    You can also add the Run As Different User to the normal right click context menu.

    Open an elevated command prompt and enter the following command.

    shellrunas /reg

    Press ENTER.

    Hope this helps.

    Thank You for using Windows 7

    Ronnie Vernon MVP

    • Marked as answer by Tyrel_F Tuesday, December 1, 2009 9:11 PM
    Tuesday, December 1, 2009 7:44 PM
  • Worked like a charm.

    Thanks!
    Tuesday, December 1, 2009 9:11 PM
  • Tried this and it does not work on cpl files.  I am trying to open appwiz.cpl as an 'actual' administrator to unistall a program.
    Monday, August 16, 2010 2:53 PM
  • Tried this and it does not work on cpl files.  I am trying to open appwiz.cpl as an 'actual' administrator to unistall a program.


    Hi CWayne

    It should work, I just tested this without any problem.

    Make sure that you create a shortcut to the Appwiz.cpl file to work with. Place it on the Desktop or any place that's handy for you.

    Regards,

    Thank You for using Windows 7


    Ronnie Vernon MVP
    Monday, August 16, 2010 3:37 PM
  • It do not work if I need to open more than one instance of a application under different user name or same user name.

     

    Kindly help me sort it out.

    Friday, October 22, 2010 12:50 AM
  • Thanks both ways worked for me. To get the context menu setup for the user I was running under, I first ran shellrunas /reg in an elevated command prompt. Then I had to also run it in a normal command prompt running under my users context.
    Wednesday, January 18, 2012 5:34 PM
  • First off, sorry to resurrect a dead thread.  I know it's bad manners.

    Secondly, I was wondering if there is a way to save credentials to the shortcut?  I have looked around and I can't find a switch that allows it to use specific credentials.  I would like to run a program as an administrator but I do not want the local user to have the password.

     

    Thanks!

    Tuesday, January 24, 2012 7:05 PM
  • Hi, I'm attempting to run appwiz.cpl with domain credentials in order to uninstall software while logged into a computer with normal user permissions.

    When I try this "fix" I get an "Error launching application: (null)"

    Does anyone have any ideas?

    Thanks,

    Thursday, January 26, 2012 10:22 PM
  • In the registry under HKCR, search for the value "Extended". Deleting that value will put options back on the standard context menu.

    For example, if you delete the "Extended" value from HKCR\batfile\shell\runasuser, then the standard context menu for batch scripts (*.bat, *.cmd) or shortcuts to batch scripts will include the run as user option.

    Similarly, if you delete the Extended value from HKCR\exefile\shell\runasuser, then the context menu for executable files will include the option to run as user.

    • Proposed as answer by AndrewWiggin Saturday, February 18, 2012 12:34 AM
    Saturday, February 18, 2012 12:34 AM
  • Ronnie,

    Great, great tool. Makes some of these "Run As" tasks so much simpler to just click, enter creds, and go.

    Tony

    Thursday, March 8, 2012 10:49 PM
  • you can use this

    create text file

    past this recordes and save with .reg file

    an double click yes ok and you will show in right click

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\exefile\shell\runasuser]
    "Extended"=-

    [HKEY_CLASSES_ROOT\batfile\shell\runasuser]
    "Extended"=-

    [HKEY_CLASSES_ROOT\cmdfile\shell\runasuser]
    "Extended"=-

    [HKEY_CLASSES_ROOT\mscfile\shell\runasuser]
    "Extended"=-

    [HKEY_CLASSES_ROOT\Msi.Package\shell\runasuser]
    "Extended"=-

    Wednesday, August 27, 2014 8:13 AM