in reply to Windows system command fails with error can't spawn "cmd.exe"

You may draw some inferences (since you haven't shown the code that produces your data) from running this:

C:\>dir CMD.exe /s

    ...and this:

C:\>dir c:\Windows\System32\cmd.exe

Further hint: what's your CWD when you try to spawn?