How do I change default startup directory for command prompt in Windows 7?
I usually do the following to start command prompt from C:\\
WIN-R (Run Promp
While adding a AutoRun entry to HKEY_CURRENT_USER\Software\Microsoft\Command Processor
like Shinnok's answer is the way to go it can also really mess things up, you really should try to detect a simple cmd.exe startup vs a script/program using cmd.exe as a child process:
IF /I x"%COMSPEC%"==x%CMDCMDLINE% (cd /D c:\)
type
cmd.exe /k cd c:/
in a text file and save as cmd.bat Clicking this file does the trick. You can pin it to the start menu as well.
To start in a partitioned drive (e.g. D), use
cmd.exe /k d:
On windows 7:
Every time you click on the cmd in your start menu or your desktop shortcut, the CMD will open in your default location
Open regedit and browse to this path
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Create new string vale named Autorun
. Set its value to cd /d C:\
.
Run cmd again. Voila!
it looks something like this :
In the new Windows Terminal, you can click Settings and edit the line "startingDirectory" to achieve something similar.
Please note, however, that this changes the default startup directory only in Windows Terminal, and not for the command prompt globally.