22

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\"

Lucas BS
  • 494

1 Answers1

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.

Paul
  • 61,193