Cmd.exe won't inherit directory

  • Thread starter Thread starter Brian Hartin
  • Start date Start date
B

Brian Hartin

Hi there,

On my PC, cmd.exe will not inherit the current directory. This is
seen from the command line, as well as when processes are launched
from scripts, etc.

I can reproduce this in a command window as follows:

(Start a command window)

C:\Documents and Settings\hartbr>cd \

C:\>c:\windows\system32\cmd.exe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\hartbr>

It should have started the new cmd.exe process in C:\. I've checked
this on several other computers and mine is the only one with this
problem.

Does anyone know what might cause this? I've been searching all day
with no luck.

Thanks!

Brian
 
Brian said:
Hi there,

On my PC, cmd.exe will not inherit the current directory. This is
seen from the command line, as well as when processes are launched
from scripts, etc.

I can reproduce this in a command window as follows:

(Start a command window)

C:\Documents and Settings\hartbr>cd \

C:\>c:\windows\system32\cmd.exe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\hartbr>

It should have started the new cmd.exe process in C:\. I've checked
this on several other computers and mine is the only one with this
problem.

Does anyone know what might cause this? I've been searching all day
with no luck.

Maybe take a look at the AutoRun value at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

The above is system wide, the same setting can also be per user, take a
look at the same key in the HKCU subtree.

John
 
Maybe take a look at the AutoRun value at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

John,

That was it! Thank you so much. Do you know how this value typically
gets set?

Thanks again,

Brian
 
Brian said:
John,

That was it! Thank you so much.

You're welcome.

Do you know how this value typically
gets set?

Typically by a user or administrator. By default the this (AutoRun)
value is not present in the HKCU branch and is blank in the HKLM branch
and the command prompt always starts in the %userprofile% directory.
Installing certain utilities might have changed or added the value.

John
 
Back
Top