I modified cmdproxy.c to pinpoint which of the 3 tests leading to the
recursive spawn fails, and also to report the error code explaining
the failure. Attached please find the modified source and the
compiled executable. After unzipping them in emacs's bin directory,
please start GDB ("gdb cmdproxy.exe"), type "dir ." (to let it pick up
the modified source), then run cmdproxy till the line where it calls
spawn, and see what the values of i, j, k tell you about which test
failed, and what the value of err says about the reason of the
failure.