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 Prompt) cmd /K cd C:\
I want to do the following to start command prompt from C:\
WIN-R (Run Prompt) cmd
This doesn't work for me. I've tried this both under Win7 64bit and Vista 32.
I'm using the below commandline to add this capability.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "IF x"%COMSPEC%"==x%CMDCMDLINE% (cd /D c:)"
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:changing shortcut under Windows System on 8.1 worked for me - another thing I found is that 'Start In:' WORKS when Advanced -> Run as admin is UNCHECKED, however, if CHECKED, it does not work
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
string: Autorun value: cd /d %~dp0
all bat files will run from the bat file location
Open regedit and browse to this path
Create new string vale named
Autorun
. Set its value tocd /d C:\
.Run cmd again. Voila!
it looks something like this :