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

  • Thread starter Thread starter Jaruzel
  • Start date Start date
J

Jaruzel

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 ?

Thanks,

Matt Owen
http:/www.mattowen.com
 
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.
 
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?

Thanks
 
Back
Top