15
3
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 manually to C:\Windows\System32\ and run CMD from there, 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\"
2
possible duplicate of How can I update the default directory for Windows Command Processor to be my home directory?, Windows 7 Administrator Command Prompt “Start in” Path
– Ƭᴇcʜιᴇ007 – 2015-05-18T00:45:38.477It's just a workaround :) Autorun holds any command to execute when the process (
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
:) – None – 2015-05-18T22:04:35.863It won't work if AutoRun is disabled by
cmd /d
:) – None – 2015-05-18T22:12:18.2231Alternatively you may use
cmd /k "cd /d %windir%\sytstem32"
for the same purpose. – None – 2015-05-18T22:15:29.780https://superuser.com/questions/49575/change-to-default-start-folder-for-windows-xp-command-prompt/49590#49590 – Ƭᴇcʜιᴇ007 – 2017-03-10T14:37:53.833
Why do you need it to open in system32? That's what mine always does by default. It never opens where I want it. Ah - Chinggis6 solved it for me. A great answer in comments. – SDsolar – 2018-04-23T19:25:57.757