howto: Change the default directory for "Command Shell" window

M

mr_unreliable

hi group,

(Background): I installed an obnoxious app, which placed itself at
the front of my path (environment variable), and also changed the
default directory of the "Command Shell" (dos?) window.

I was able to reset the path to my liking, by using the Start =>
Settings => System => Advanced => Environment Variables dialog.

However, I couldn't figure out how to re-set the default directory
for the "command shell" window. If I open the window, it will
respond to a "cd" command, and so I can manually reset the default
directory.

I have looked through the registry, but couldn't find a likely
entry to use re-set the default directory. I also tried placing
a "cd" command in the (er, both) autoexec.bat file(s), the common
autoexec.bat and the user acct autoexec.bat. There was no
error thrown by either of the autoexec.bat files, but still
the default for the "command shell" didn't change.

So, what am I missing here. How does one go about re-setting the
default directory for the "command shell" window???

tiafah, jw

p.s. if this belongs in another ng, please advise.
 
H

Haggis

mr_unreliable said:
hi group,

(Background): I installed an obnoxious app, which placed itself at
the front of my path (environment variable), and also changed the default
directory of the "Command Shell" (dos?) window.

I was able to reset the path to my liking, by using the Start =>
Settings => System => Advanced => Environment Variables dialog.

However, I couldn't figure out how to re-set the default directory
for the "command shell" window. If I open the window, it will
respond to a "cd" command, and so I can manually reset the default
directory.

I have looked through the registry, but couldn't find a likely
entry to use re-set the default directory. I also tried placing
a "cd" command in the (er, both) autoexec.bat file(s), the common
autoexec.bat and the user acct autoexec.bat. There was no
error thrown by either of the autoexec.bat files, but still
the default for the "command shell" didn't change.

So, what am I missing here. How does one go about re-setting the
default directory for the "command shell" window???

tiafah, jw

p.s. if this belongs in another ng, please advise.

correct news group :>

COMSPEC default is %SystemRoot%\system32\cmd.exe
 
T

Torgeir Bakken \(MVP\)

Hi Jim,

Create or set the "AutoRun" registry value (REG_SZ) under

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\
or
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\

If you do it under HKEY_LOCAL_MACHINE, it will apply to all user
profiles. Note that if it is set both places, the HKEY_CURRENT_USER
one will "win".

Example on setting AutoRun so the command prompt always will open in
the root of the C: drive:

"AutoRun"="CD /D C:\"


Regards,
Torgeir
 

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

Top