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\"
cmd.exe
) is started. It won't work in many cases such as if%homedrive%
is notc:
ascd
would require/d
switch to change into another drive, or%windir%
is notc:\windows
:)cmd /d
:)cmd /k "cd /d %windir%\sytstem32"
for the same purpose.