1. Joined : Sep 2016
    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 System SpecsSystem Spec


  2. Joined : Jul 2014
    San Jose, California
    Posts : 1,956
    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:	23 
Size:	48.5 KB 
ID:	102538
      My System SpecsSystem Spec


  3. Joined : May 2015
    Central IL
    Posts : 3,076
    EL Capitan
       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 System SpecsSystem Spec


  4. Joined : Aug 2016
    Posts : 27
    Windows 10
       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:
    Elevated Command Prompt - Open in Windows 10

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


  5. Joined : Oct 2013
    Posts : 17,444
    64-bit Windows 10 Pro build 15014
       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 System SpecsSystem Spec


  6. Joined : Apr 2015
    Posts : 80
    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 System SpecsSystem Spec


 


Similar Threads
Thread Forum
No admin rights for admin account after clean install
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...
User Accounts and Family Safety
Windows Explorer crashes when I open File Explorer
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?
Performance & Maintenance
System error 5 | No admin rights | Lost admin password | can't reset
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...
User Accounts and Family Safety
Windows 10 admin password reset or new account with admin rights
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...
User Accounts and Family Safety
File Explorer slow to open or will not open
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...
General Support
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 13:14.
Find Us
Twitter Facebook Google+



Windows 10 Forums