# How do I prevent ruby on windows from automatically converti

**URL:** <https://www.ruby-forum.com/t/how-do-i-prevent-ruby-on-windows-from-automatically-converti/103012>\
**Category:** Ruby\
**Created:** [April 30, 2007, 8:03pm UTC](https://www.ruby-forum.com/t/how-do-i-prevent-ruby-on-windows-from-automatically-converti/103012 "2007-04-30T20:03:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlorimor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/96bed5/32.png) [@rlorimor](https://www.ruby-forum.com/u/rlorimor)\
**Post date:** [April 30, 2007, 8:03pm UTC](https://www.ruby-forum.com/t/how-do-i-prevent-ruby-on-windows-from-automatically-converti/103012/1 "2007-04-30T20:03:20Z")

</div>

I have a Windows batch file (mytest.bat) that calls a Ruby script  
(mytest).

The mytest.bat looks like this:

ruby %TOOLDIR%\bin\mytest %\*

When the batch file is called using “call mytest” from another Ruby  
script, it is automatically converting the command-line arguments.  
Specifically, it is converting path arguments:

mytest -i “\testdir\mytests\test.dat”

becomes

“/testdir/mytests/test.dat”

I do not want Ruby converting these paths. It seems like it is going  
through each string argument, detecting that it is a path and  
normalizing/converting each path from Windows-style to UNIX-style.

How do I stop Ruby from doing this?

---

<div class="post-metadata">

**Author:** ![rlorimor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/96bed5/32.png) [@rlorimor](https://www.ruby-forum.com/u/rlorimor)\
**Post date:** [April 30, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/how-do-i-prevent-ruby-on-windows-from-automatically-converti/103012/2 "2007-04-30T21:40:28Z")

</div>

On Apr 30, 1:02 pm, removed\_email\_address@domain.invalid wrote:

> becomes
> 
> “/testdir/mytests/test.dat”
> 
> I do not want Ruby converting these paths.

Why not? Are you aware that even under windoze, if a program  
written in Ruby or awk or Perl tries to open “/testdir/mytests/  
test.dat”,  
it will do the right thing?

By the way, how is your program converting these paths?  
Are you using File::expand\_path?
