Issue #1482 has been updated by usa (Usaku NAKAMURA).

Status changed from Feedback to Assigned

Now ruby recognize batch files as "programs", so they are simply passed to
CreateProcess() API.
So, current behavior is Windows' spec.

However, I suspect that this (= simply being passed to CreateProcess API) is not intended.
I'll discuss about it with nobu next week.
----------------------------------------
Feature #1482: Kernel.exec doesn't respect COMSPEC environment variable on Windows
https://bugs.ruby-lang.org/issues/1482#change-31794

Author: dolzenko (Evgeniy Dolzhenko)
Status: Assigned
Priority: Low
Assignee: usa (Usaku NAKAMURA)
Category: core
Target version: 2.0.0


=begin
 Here is pretty convoluted test case:
 
 puts ENV["COMSPEC"] # => "C:\WINDOWS\system32\mycmd.exe"
 
 File.open("1.bat", "w") { |f| f.write("time") } # create test batch file with command which waits for user input
 
 Kernel.exec("1.bat") # now the process tree inspection shows that the "C:\WINDOWS\system32\cmd.exe" is still used to interpret 1.bat
=end



-- 
http://bugs.ruby-lang.org/