Make Elevated Command Prompt open to %userprofile%


  1. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #1

    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 way to do this. Using the Start in filed of properties doesn't work.
      My Computers


  2. Posts : 68,677
    64-bit Windows 11 Pro for Workstations
       #2

    Hello Rich, :)

    You could create a shortcut using the command below, then set the shortcut to "Run as administrator" to do so.

    cmd /s /k cd %UserProfile%

    Run as Administrator in Windows 10 - Windows 10 Forums
      My Computers


  3. Posts : 4,132
    Windows 3.1 to Windows 11
       #3

    I want it to open to %userprofile% which is C:\Users\myaccountname.
    That would be a standard command prompt (non-admin)
      My Computer


  4. Posts : 17,838
    Windows 10
       #4

    WinX Menu, #9
      My Computer


  5. Posts : 68,677
    64-bit Windows 11 Pro for Workstations
       #5

    I believe Rich is wanting to open an elevated command prompt, but have it open to %UserProfile% instead of the default System32.
      My Computers


  6. Posts : 201
    Kernel 4.x.x
       #6

    Edit:

    Better method

    Modify the shortcut target to:
    Code:
    %COMSPEC% /C PUSHD %USERPROFILE% && %COMSPEC%
    That should work
      My Computers


  7. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #7

    You asked the same question and was answered 6 months ago:
    Solved Get elevated command prompt to open in my user directory - Windows 10 Forums
      My Computer


  8. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
    Thread Starter
       #8

    topgundcp said:
    You asked the same question and was answered 6 months ago:
    Solved Get elevated command prompt to open in my user directory - Windows 10 Forums
    Sorry, my mind isn't what it used to be I guess. I had completely forgotten about that thread.

    I saved info from both threads this time and now have a working Admin Command prompt that opens to my user profile folder.

    Thanks everyone.

    Hydranix, I haven't tried your suggestion yet, will in a few minutes though.

    Edit: Hydranix, yes, this works well also. Thanks
      My Computers


  9. Posts : 68,677
    64-bit Windows 11 Pro for Workstations
       #9

    No worries Rich. Glad we could help. :)
      My Computers


 

  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 18:42.
Find Us




Windows 10 Forums