(#10799) Regexp escaping too much
Previously, we were substituting occurrences of <ruby> and <command>
in the Windows batch wrapper scripts with the corresponding
paths. However, the call to Regexp.gsub was escaping potential
backreferences in the replacement string, e.g. foo\1bar, but in doing
so, was also escaping valid path characters that don't need to be
escaped, e.g. ruby-1.8.7, causing the batch file to refer to
non-existent paths, e.g. ruby\-1\.8\.7.
This commit eliminates the need for gsub and regexp escaping.
It also writes the bat file in 'text' mode so that the resulting file
has '\r\n' line endings.