From: Brian Hartin on
Hi there,

I'm having trouble with child processes not inheriting their parent's
'current' directory. This is
seen from the command line, as well as when I use scripts to execute
shell commands.

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
From: Matti Vuori on
Brian Hartin <brian.hartin(a)gmail.com> wrote in news:e52e3e42-faa3-49e3-
accb-90a0c74ddcc8(a)f14g2000vbn.googlegroups.com:
> Does anyone know what might cause this? I've been searching all day
> with no luck.

I don't think there's even a way to cause it deliberately, so I guess
something must have got broken...

As the environment is transferred to the child process in memory, I would
run a memory tester like Memtest86+ http://www.memtest.org/

If the memory is ok, I would check the disk -- and especially cmd.exe

And in the case something has gone wrong during the past few days, I would
try to restore the system to some old restoring point

Etc...
From: Brian Hartin on
> And in the case something has gone wrong during the past few days, I would
> try to restore the system to some old restoring point
>
> Etc...

It was a registry value: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command
Processor. It had something like 'cmd.exe /c CD C:\Documents and
Settings\Hartbr'. That caused every new instance of cmd.exe to start
in that directory. Not sure how that setting got there.