Odd Behavior: CMD.EXE / Command Prompt default folder changing ?



Hi all,

I've stumbled over a peculiarity in my Windows SP3 Pro (+ all
hotfixes) build (it's for mass deployment, but this isn't a deployment
issue per se).

Basically the CMD.EXE default folder is following the current explorer
window folder.

For example, if I have explorer open at C:\Drivers\Intel and then
click on Start Menu, then RUN, and type ONLY 'cmd' and click OK,
instead of cmd.exe launching with my profile folder as the default
folder, it opens with the current explorer path as the default folder,
ie. C:\Drivers\Intel. It doesn't matter where on the disk explorer is
pointing to, cmd.exe will mirror it.

Whereas this behavior is nice, I am concerned that I don't know what
changed it, or why. My primary issue is that this may affect any batch
files or scripts that launch in the user context.

I HAVE checked the Command Processor\AutoRun keys in the registry and
they are blank or non-existent, so it isn't that.

Any ideas, anyone, as to what caused this change in behavior ?


Matt Owen



Tim Meddick

Hi Jaruzel,
to change the default folder back to your user profile
folder add this line to the file Autoexec.nt in the system32 folder:

if %1]==] cd %USERPROFILE%

Adding this will NOT affect the right-click "Command Prompt from Here" shell
extension, will work as normal. Or you could change %USERPROFILE% for any
folder you want to be the default folder for Command Prompts.


Nov 4, 2009
Reaction score
I want to achieve the exact opposite.
I have seen computers with that behavior but havent been able to figure out how to make the command prompt open in the current active directory.

Can you tell me how this is done?


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question