How to create a proper Admin-DOS/PowerShell shortcut?

Discussion in 'Windows 7' started by MonarchX, Nov 15, 2015.

  1. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    Please don't ban me for asking, but I can't figure out how to create a proper CMD/PowerShell shortcut. When I type PowerShell or Command Prompt in "Start" --> "Search Programs and Files", I can select either CMD or PowerShell (depending what I typed in "Search Programs and Files"), then right-click, select "Run as Administrator" and all DISM commands like RestoreHealth and SFC Sannow command work wonderfully. However, if (after I type in whichever one in "Search Programs and Files") I drag CMD or PowerShell programs onto my desktop, I get a shortcut, which does not work properly. If I run either CMD or PowerShell shortcuts "As Administrator", then DISM commands and SFC Scannow command do not work. I think they tell me something about 32bit execution within 64bit environment or something like that, but both - the CMD shortcut and the actual CMD program (that shows up after type "Command Prompt" in "Search Programs and Files") start in the same location (system32) and look identical...

    How can I make a proper CMD and/or PowerShell shortcuts that act exactly like the programs to which they are linking/connected when used with "Run as Administrator".
     
  2. LiteOS

    LiteOS Windowizer

    Mar 7, 2014
    2,209
    984
    90
    #2 LiteOS, Nov 15, 2015
    Last edited: Nov 15, 2015
    right click on the shortcut
    go to advanced mark run as administrator

    if there a script u want to run add to command line as parameter and run from powershell ise

    or go to system32 directory find the powershell u want to runas admin
    right click comp.. tab and then run this as admin
     
  3. shamu726

    shamu726 MDL Junior Member

    Nov 29, 2012
    51
    22
    0
    Actually, right-clicking and selecting "Run as Administrator" is the same for both exes and their shortcuts. It has always worked that way for me.

    Just tried in Win10: dragged cmd.exe from start menu to desktop to create shortcut. Right-clicked and selected "Run as Administrator" and ran dism commands. No errors.