http://qs321.pair.com?node_id=762770


in reply to waitpid on Win32 ... wait forever

I haven't been using Windows for over 10 years so I'm not entirely sure, but it might be possible that "cd" isn't an actual command but some sort of built-in shell function in command.com or whatever Windows uses these days. So maybe you get no PID at all, or the PID of the parent (the shell)?

Either way, "cd" might be a special case. Unless this really is what you want to do, I suggest you try using some other command.