wtorek, 26 maja 2009

Getting rid of cmd.exe window in cygwin/x11

I have been using cygwin environment for a long time, including x11 applications and I would like to get rid of cmd.exe window every time I am running an application, via Start Menu -> Run. This is really annoying.
I have been googlin' for several months for the solution. I found a snippet to be run via Windows Scipting Host. Here it is:

CreateObject("WScript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

(to be saved, for instance, as c:\snippet.exe)

Example of use:

wscript.exe c:\snippet.vbs xterm

Pros: cmd.exe window does not appear any more

Cons: I am not familiar with WSH api and I don't know how to pass an extra argument or arguments to the command being run.

Anyway, this solution works.

0 komentarze: