# DOS box popping up under rubyscript2exe

**URL:** <https://www.ruby-forum.com/t/dos-box-popping-up-under-rubyscript2exe/142578>\
**Category:** wxRuby\
**Created:** [July 9, 2008, 11:53am UTC](https://www.ruby-forum.com/t/dos-box-popping-up-under-rubyscript2exe/142578 "2008-07-09T11:53:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [July 9, 2008, 11:53am UTC](https://www.ruby-forum.com/t/dos-box-popping-up-under-rubyscript2exe/142578/1 "2008-07-09T11:53:33Z")

</div>

Hello

My email has been broken for a week and some of it seems to have gone  
astray - so if there are other unanswered wxruby queries kicking about,  
please repost or forward me them.

I have encountered this problem with a DOS box popping up under rubyw /  
rubyscript2exe; I don’t think it’s related to wxruby. I found them  
popping up when shelling out with backticks - I believe the way that  
ruby executes external programs on Windows causes this if no command  
shell is already present. This may be what’s happen with receiving a  
message from an external program in your case.

I got round it by calling the external program via Win32API on Windows,  
instead of ruby’s own system/backticks. There’s some code that  
encapsulates this here:

[http://weft-qda.rubyforge.org/svn/branches/stable\_1-0/weft-qda/lib/weft/filters/win32backtick.rb](http://weft-qda.rubyforge.org/svn/branches/stable_1-0/weft-qda/lib/weft/filters/win32backtick.rb)

hth  
alex

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [July 9, 2008, 3:04pm UTC](https://www.ruby-forum.com/t/dos-box-popping-up-under-rubyscript2exe/142578/2 "2008-07-09T15:04:39Z")

</div>

Thanks, Alex. I did find a place where I was doing `hostname` and  
getting  
rid of this fixed the problem.

Eric

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [July 9, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/dos-box-popping-up-under-rubyscript2exe/142578/3 "2008-07-09T17:37:17Z")

</div>

You actually should be able to get the hostname, via Wx::get\_host\_name()  
which will return the hostname of the machine that the application runs  
on.
