20

I want to change the CMD startup directory when I launch it via Start+R

Currently, it points to my users folder. I need it to point to C:\Windows\System32\

When I navigate using explorer to C:\Windows\System32\ and run CMD from there (Shift+RightClick on an empty area), it starts in the desired path. When I run from Win+R, it starts from the users folder.

I suspect I need to change the registry or an environment variable. Anyone knows how to ?

THIS QUESTION IS DIFFERENT FROM THE OTHERS FOR THE REASON EXPLAINED BY @KARAN (READ THE THIRD COMMENT FROM THE ANSWERS BELOW)

DIFFERENT ANSWERS ONLY WORK FOR SHORTCUTS

Edit: Found the right answer hidden on the pit of the provided links, kilometers away from the supposed "right answer"

[HKEY_CURRENT_USER\Software\Microsoft\Command Processor] "Autorun"="cd C:\Windows\System32\"

10
14

If you hit the Win (Start) button and type CMD search field, instead of clicking Command Prompt (cmd.exe or Command Prompt depending on Windows version), either right click and choose properties, or if not present, choose Open File Location then right click and choose properties of the CommandPrompt shortcut.

You can get to it directly in this folder: %APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools

In the "Start in:" field, it normally says %HOMEDRIVE%%HOMEPATH%

This makes cmd start in the home folder. You can change this to be whatever you'd prefer.

7
  • Win+R (which is what I suppose he means by Start+R) is the Run dialog, and you're confusing it with searching in the Start Menu for the Command Prompt shortcut. If he opens a command prompt window by typing cmd in the Run dialog, what you've suggested obviously won't work for him.
    – Karan
    May 18 '15 at 0:57
  • 1
    @Karan I am interpreting what the OP wrote as using Start+R (Win+R) and typing cmd - so unless my interpretation is incorrect, then this answer will work for him (try it). In any case, it is a dupe by the look of it, I should have checked.
    – Paul
    May 18 '15 at 1:08
  • You're asking me to try it? Please try it yourself. Go ahead: press Win+R, type cmd in the text field, right-click it and now where do you see Properties? Let me repeat, you've confused typing cmd in the Run dialog (Win+R) with searching for the Command Prompt shortcut in the Start Menu (Win). Only the shortcut has a Properties dialog you can edit.
    – Karan
    May 18 '15 at 1:12
  • @Karan Crap, sorry, you are right, I instinctively hit the win button and typed it, missed what you were saying.
    – Paul
    May 18 '15 at 1:16
  • 1
    @KalpeshSoni Answer updated to reflect more recent versions.
    – Paul
    Jun 12 '18 at 22:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.