How to use RunAs without password prompt?

Page 2 of 2 FirstFirst 12

  1. Posts : 68,894
    64-bit Windows 11 Pro for Workstations
       #11

    Miro,

    If it helps, here's an option for adding an Open command window here as administrator context menu.

    Open command window here as administrator - Add in Windows 10 | Windows 10 Tutorials
      My Computers


  2. Posts : 69
    Windows 10 Pro x64
    Thread Starter
       #12

    Helped not, I'm not working with PowerShell.

    Miro
      My Computer


  3. Posts : 1,759
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #13

    Ah, now I understand what you mean. You want this:
    How to use RunAs without password prompt?-context-menu.jpg

    Here's how I do this.
    1. Download NirCMD, extract to C:\Windows\System32. (Make sure you download the right 'bitness', i.e. x64 or x32.)
    2. Right-click on nircmd.exe, choose Properties and make sure the file is unblocked.
    3. Save the following as something like runas_regedit_admin.reg:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Run Regedit as Administrator]
    "Icon"="C:\\Windows\\regedit.exe,0"
    "MUIVerb"="Run Regedit as Administrator"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Run Regedit as Administrator\command]
    @="nircmd.exe elevate regedit.exe"
    4. Save the following as something like open_cmd_as _admin_here.reg:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Open CMD here as Administrator]
    "Icon"="C:\\Windows\\System32\\cmd.exe,0"
    "MUIVerb"="Open CMD here as Administrator"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Open CMD here as Administrator\command]
    @="nircmd elevate cmd.exe /s /k pushd \"%V\"⧹"
    5. Merge both REG files into the registry.

    (The above has been tested as working in Win 10 Home 1803 Build 17134.48. See this webpage for more examples of using NirCMD. Note: I also tried Nir Sofer's AdvancedRun but the syntax was not so straightforward.)

    Hope this helps...
      My Computer


  4. Posts : 69
    Windows 10 Pro x64
    Thread Starter
       #14

    This help was better than best!
    NirSoft offers lot of tools which are perfect to use.

    Thank you very much!
    We can close thread, no matter if was RunAs solved by Windows or other tools.

    Miro
      My Computer


  5. Posts : 1,759
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #15

    Hmmm... well, I have to laugh. After working out how to do what the OP wanted using NirCMD, I found a small, free utility that does exactly the same but with no effort whatsoever.

    If anyone wants right-click versatility, have a look at Sordum.org's Easy Context Menu v1.6 (and use its built-in List Editor to amend the properties of list items, e.g. to add or remove 'Run as administrator' option.) If only I'd found this earlier.

    Note: It says it's portable but I found it had written to C:\Program Files\Easy Context Menu and in a Files sub-folder I found NirCMD... so I guess that's how ECM adds elevation.

    Hope this helps...
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:42.
Find Us




Windows 10 Forums