From: Zach Dennis Date: 2003-12-03T07:23:19+09:00 Subject: Hiding the CMD Window/Ruby Interpreter with Win32API I spent the last hour figuring out how to hide the cmd.exe (dos) window/ruby interpreter when running my ruby script. I didn't see any direct answers to this question so here is how I got it to work. require 'Win32API' getConsoleWindow = Win32API.new("kernel32" , "GetConsoleWindow" , [] , 'L') ptr_to_console = getConsoleWindow.call() wndConsole = Win32API.new( "user32" , "ShowWindow" , ['p' , 'i'] , 'i' ) bl = wndConsole.call( ptr_to_console , 1 ) To do a quick test you can do: require 'Win32API' require 'tk' getConsoleWindow = Win32API.new("kernel32" , "GetConsoleWindow" , [] , 'L') ptr_to_console = getConsoleWindow.call() wndConsole = Win32API.new( "user32" , "ShowWindow" , ['p' , 'i'] , 'i' ) wndConsole.call( ptr_to_console , 1 ) Tk.mainloop ----- Zach For any search engines scanning this page: Hide Ruby DOS CMD.exe intpreter window