Windows 10: Open cmd from file explorer with admin rights


  1. Posts : 1
    Windows 10 Pro x64
       21 Sep 2016 #1

    Open cmd from file explorer with admin rights


    I managed to get cmd to always run as admin from start->cmd

    But running cmd this way always launch it at the windows/system32 directory.

    I need a way to run cmd in file explorer directly so that the current directory will be at the path I launched it but it is always launching without the admin rights.
      My ComputerSystem Spec


  2. Posts : 2,034
    Ubuntu14.04x64 MintMate17x64 Win10Prox64
       22 Sep 2016 #2

    Easiest way is to have it run from right click context menu. Copy and paste the code and save it as .reg file. Double click on the file to merge to the registry. Right click anywhere on desktop/file explorer, select "Admin Command Here":
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
    @="Admin Command Here"
    "NoWorkingDirectory"=""
    "HasLUAShield"=""
    "Position"="Top"
    "Icon"="C:\\Windows\\System32\\cmd.exe"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
    @="cmd.exe /s /k pushd \"%V\""
    Click image for larger version. 

Name:	a.jpg 
Views:	26 
Size:	48.5 KB 
ID:	102538
      My ComputerSystem Spec


  3. Posts : 3,708
    Mac OS Sierra
       22 Sep 2016 #3

    You have to open File Explorer, go to the directory that you want it to run in, then right click and run Command in that directory. The only time that you want to open Command in a particular directory, is if you are going to run say Powercfg and need the report from it placed into that directory.
      My ComputerSystem Spec

  4.    22 Sep 2016 #4

    KyoSuke said: View Post
    I managed to get cmd to always run as admin from start->cmd

    But running cmd this way always launch it at the windows/system32 directory.

    I need a way to run cmd in file explorer directly so that the current directory will be at the path I launched it but it is always launching without the admin rights.
    Please check out this tutorial:
    https://www.tenforums.com/tutorials/2...dows-10-a.html

    "Option 7" should be what you're looking for.
    Last edited by Brink; 22 Sep 2016 at 09:47. Reason: link
      My ComputerSystem Spec


  5. Posts : 22,835
    64-bit Windows 10 Pro build 16257
       22 Sep 2016 #5

    Hello KyoSuke, and welcome to Ten Forums.

    If you like, the tutorial below can help you to easily add this option to your context menu.

    Open command window here as administrator - Add in Windows 10
      My ComputersSystem Spec


  6. Posts : 169
    Windows 10 Home x64 and Pro x86
       23 Sep 2016 #6

    You can add the necessary command to the File explorer Quick access toolbar [without doing any Registry edits or using any additional utilities].

    In File explorer,
    click on File ,
    hover over Open command prompt,
    right click on Open command prompt as administrator,
    select Add to Quick access toolbar.

    The facility will then always be readily available to you on the QAT so you can get an Admin prompt open set to the current File explorer folder when you need it.

    [You can also do this with the standard Open command prompt entry]

    Denis
      My ComputerSystem Spec


 

Related Threads
No admin rights for admin account after clean install in User Accounts and Family Safety
Recently I did a clean install from the windows installation tool off a CD I made. Soon after logging on and making my first account (again!) I couldn't open the C drive. I messed with the owner options and made my account the owner so I could open...
So whenever I click File Explorer on the taskbar or in the start menu, Windows Explorer crashes and I need to go into task manager and restart it. But if I click a folder on my desktop it doesn't crash?
Hi Yet again, Windows is frustratingly taking up all of my time and I have tried everything google has to offer to try and fix it but it seems like no one has screwed up as much as I have on whatever forum. Let me explain the problem: I'm...
The firm in which I work has a Lenovo PC with Windows 10 installed. There are two user profiles on the computer, the admin and another normal account without administration rights. We have only the password of the account without administrator...
Quite often (60% of the time) clicking on Windows Explorer results in no action whether from the tool bar or from the Windows screen for a very long period of time. There is nothing showing to determine if there is a background program causing...
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 11:18.
Find Us