Forum: Ruby-core Kernel.exec doesn't respect COMSPEC environment variable on Windows

Posted by Nobuyoshi Nakada (nobu)
on 2013-02-27 13:16
(Received via mailing list)
Issue #1482 has been updated by nobu (Nobuyoshi Nakada).


Unfortunately, I've lost my topic branch for this issue, so have to 
rewrite from the previous patch again.
----------------------------------------
Feature #1482: Kernel.exec doesn't respect COMSPEC environment variable 
on Windows
https://bugs.ruby-lang.org/issues/1482#change-37149

Author: dolzenko (Evgeniy Dolzhenko)
Status: Assigned
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: current: 2.1.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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.