Subject: bug#18745:

From: Eli Zaretskii <[email-masked]>
Date: Fri, 30 Oct 2015 16:55:03 +0200

> From: Juanma Barranquero <[email-masked]>
> Date: Fri, 30 Oct 2015 15:25:37 +0100
> Cc: [email-masked]
> 
> C:\...\test> emacs -Q --batch --eval "(let ((process-environment '(\"TEST=BBB\"
> \"COMSPEC=C:\\Windows\\system32\\cmd.exe\"))) (call-process
> \"c:/devel/emacs/repo/trunk/test.bat\"))"
> 
> C:\...\test> type test.log
> TEST=BBB
> COMSPEC=C:\bin64\JPSoft\TCMD\TCC.EXE
> 
> Is that expected?

No, but it could be some TCC magic, aimed at intercepting any explicit
references to cmd.exe.

What happens if you replace test.bat with a compiled C program that
calls getenv to look at these two variables -- do you see the same
there?  (You could use Emacs with a suitable --eval argument to
emulate such a "C program".)