Prev: Make a specific area on a HDC transparent
Next: How to C++ exe without installing C++ Redistributable Package
From: Brian Hartin on 27 May 2010 17:00 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 27 May 2010 17:59 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 1 Jun 2010 10:19
> 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. |