# Hiding default console window

**URL:** <https://www.ruby-forum.com/t/hiding-default-console-window/151221>\
**Category:** Ruby\
**Created:** [October 18, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/hiding-default-console-window/151221 "2008-10-18T12:25:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matmarex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@matmarex](https://www.ruby-forum.com/u/matmarex)\
**Post date:** [October 18, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/hiding-default-console-window/151221/1 "2008-10-18T12:25:53Z")

</div>

I wrote simple Ruby console program that reads file, modifies it in way  
that’s not important now, and saves it back. It’s called by other  
program few hundred times, and every time console winodw appears, what  
disturbs normal working. Is it possible to hide that window (or at least  
make it to not be focused) without libs like GTK/Tk?

I already tried googling, but everytime I search “ruby windows”, it  
gives libs or installers for Windows 😕

---

<div class="post-metadata">

**Author:** ![matmarex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@matmarex](https://www.ruby-forum.com/u/matmarex)\
**Post date:** [October 18, 2008, 1:33pm UTC](https://www.ruby-forum.com/t/hiding-default-console-window/151221/2 "2008-10-18T13:33:08Z")

</div>

2008/10/18 – – [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I wrote simple Ruby console program that reads file, modifies it in way  
> that’s not important now, and saves it back. It’s called by other  
> program few hundred times, and every time console winodw appears, what  
> disturbs normal working. Is it possible to hide that window (or at least  
> make it to not be focused) without libs like GTK/Tk?
> 
> I already tried googling, but everytime I search “ruby windows”, it  
> gives libs or installers for Windows 😕  
> You should use rubyw.exe in that case.

Refer to [http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.html#S2](http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.html#S2)

Regards,

Park H.

---

<div class="post-metadata">

**Author:** ![matmarex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@matmarex](https://www.ruby-forum.com/u/matmarex)\
**Post date:** [October 18, 2008, 3:24pm UTC](https://www.ruby-forum.com/t/hiding-default-console-window/151221/3 "2008-10-18T15:24:42Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![matmarex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@matmarex](https://www.ruby-forum.com/u/matmarex)\
**Post date:** [October 18, 2008, 8:31pm UTC](https://www.ruby-forum.com/t/hiding-default-console-window/151221/4 "2008-10-18T20:31:55Z")

</div>

Heesob P. wrote:

> Refer to [http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.html#S2](http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.html#S2)
> 
> Regards,
> 
> Park H.

and if you’re using the 1-click ruby, then .rbw is already associated  
with rubyw.exe.
