Windows 10: Get elevated command prompt to open in my user directory

Discus and support Get elevated command prompt to open in my user directory in Windows 10 Support to solve the problem; I changed Command Prompt on my Taskbar so when I click on it, it opens as Administrator. That sets the default directory as C:\WINDOWS\system32 which... Discussion in 'Windows 10 Support' started by Ztruker, Sep 25, 2015.

  1. Ztruker Win User

    Get elevated command prompt to open in my user directory


    I changed Command Prompt on my Taskbar so when I click on it, it opens as Administrator.
    That sets the default directory as C:\WINDOWS\system32 which I don't like, since any files I create that do not have a path specified will be created there.

    I want it to open in my user directory.

    When I look at the properties I see Start in: %homedrive%%homepath% which converts to C:\Users\myaccountname yet when I launch the Command Prompt it still goes to C:\WINDOWS\system32.


    Get elevated command prompt to open in my user directory [​IMG]


    Any ideas how to make this work?

    :)
     
    Ztruker, Sep 25, 2015
    #1

  2. how do i make myself the administrator

    What folder, specifically?



    I'd open an
    elevated command prompt
    and type in "explorer.exe" and press enter to open the Windows Explorer application as the administrator OR simply open an

    elevated command prompt
    and rmdir the directory in question from there.
     
    Shenan Stanley, Sep 25, 2015
    #2
  3. DaveM121 Win User
    Unable to open elevated command prompt after update

    Hi Dax:copyright:,

    Right click your Desktop, choose new Shortcut

    Set location to cmd.exe and name to Command

    Click Finish

    Right click the new shortcut and choose properties

    Click Advanced and check the option to run as Administrator

    Click OK to close both dialogs

    Double click that shortcut - does command open as Administrator?
     
    DaveM121, Sep 25, 2015
    #3
  4. topgundcp Win User

    Get elevated command prompt to open in my user directory

    Create a shortcut with:
    C:\Windows\system32\cmd.exe /K cd %USERPROFILE%
    and set to run as Admin
    OR use the below for any folder


    Copy and paste the following in a .reg file then merge to the registry. This will add to right click context menu
    Right click ->Open Admin Command here will open the command default to the current folder where the mouse is pointing at. This is more flexible than just your user folder.

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
    @="Admin Command Here"
    "NoWorkingDirectory"=""
    "HasLUAShield"=""
    "Position"="Top"

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
    @="cmd.exe /s /k pushd "%V""


    Get elevated command prompt to open in my user directory [​IMG]
     
    topgundcp, Sep 25, 2015
    #4
  5. Ztruker Win User
    The last part seems to be wrong, extra double quote at end.

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
    @="cmd.exe /s /k pushd "%V""

    I changed it to

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
    @="cmd.exe /s /k pushd "%V"

    and it works, but opens to my Desktop directory. I'd like to backup one level to my user directory but this is useable, thanks.

    I would still like to be able to modify the Command Prompt.
     
    Ztruker, Sep 25, 2015
    #5
  6. topgundcp Win User
    Right click context menu is more flexible. If your file explorer is currently pointing at your USER then it will open as C:\Users\Rich

    I edited for the user above:
    Create a shortcut with:
    C:\Windows\system32\cmd.exe /K cd %USERPROFILE%
    and set to run as Admin
     
    topgundcp, Sep 25, 2015
    #6
  7. Brink
    Brink New Member
  8. Ztruker Win User

    Get elevated command prompt to open in my user directory

    Perfect!!! Thanks (also thanks on eightforums *Smile )
     
    Ztruker, Sep 26, 2015
    #8
  9. Ztruker Win User
    Ztruker, Sep 26, 2015
    #9
  10. Brink
    Brink New Member
    You're welcome Rich. Glad it could help. *Smile
     
    Brink, Apr 4, 2018
    #10
Thema:

Get elevated command prompt to open in my user directory

Loading...
  1. Get elevated command prompt to open in my user directory - Similar Threads - elevated command prompt

  2. elevated admin command prompt

    in Windows 10 Customization
    elevated admin command prompt: where is the dictionary and/or the appendix for the language to use in the elevated admin command prompt??? I would prefer to simply ask my friends in redmond at the garage to imput the needed code/txt so that my thumbs dont go numb...lolol...
  3. Unable to change -Command Prompt - To :- Elevated Command Prompt

    in Windows 10 BSOD Crashes and Debugging
    Unable to change -Command Prompt - To :- Elevated Command Prompt: Having problem installing updates windows 10 64bit - version 2004 -- need to access command prompt as an Administrator to try to fix. Any ideas ?...
  4. Open Elevated Command Prompt via Context Menu ...

    in Windows 10 Support
    Open Elevated Command Prompt via Context Menu ...: ... as the post title. My search here only found a tutorial for a 'standard' command prompt. -thx 167608
  5. Access Denied in elevated command prompt

    in Windows 10 Customization
    Access Denied in elevated command prompt: Hello everybody, I'm trying to run a simple command in an elevated Command Prompt that acts on a folder that resides on a secondary HDD. That drive and the entirety of its contents have my only machine's user account also the administrator set as the owner, as does...
  6. Run vs. Command Prompt vs Elevated command prompt?

    in Windows 10 Support
    Run vs. Command Prompt vs Elevated command prompt?: Is there a rule of thumb to know which of the referenced you would use when entering a particular command or file name? Mark 112722
  7. Can’t Open Elevated Command Prompt

    in AntiVirus, Firewalls and System Security
    Can’t Open Elevated Command Prompt: Hello I just installed WIN 10 on an old laptop (if one can call a lenovo W700 a laptop), used a win7 product key and the authentication was accepted had to create a microsoft account, refuse to give them all kind of info... arghhh I am now trying to put in the LENOVO...
  8. Can you open Elevated Command Prompt from Command Prompt?

    in Windows 10 Support
    Can you open Elevated Command Prompt from Command Prompt?: I have read everything I can find on Error messages regarding looping of Preparing to Repair. I can not open my computer to Windows...it never loads. I started experiencing problems a while ago. Finally, I would be able to get on line, but only for about a minute before it...
  9. Make Elevated Command Prompt open to %userprofile%

    in Windows 10 Support
    Make Elevated Command Prompt open to %userprofile%: I have the Command Prompt icon on my Taskbar as I use it a lot. It's set to always run as Administrator, so when I launch it, the Command Prompt window opens to C:\Windows\system32. I want it to open to %userprofile% which is C:\Users\myaccountname. Has anyone found a...
  10. Open Elevated Command Prompt in Windows 10

    in Windows 10 Tutorials
    Open Elevated Command Prompt in Windows 10: How to: Open Elevated Command Prompt in Windows 10 [img] Information A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands in an elevated command prompt, you can perform tasks that require administrator rights on...