get rid of dos window?

Andrew McRae
Wed Dec 12 09:28:00 GMT 2001

Armin Hartinger wrote:
> Anyway, to the point: I want to just throw a
> batch-file into the windows-startup folder,
> which starts up the X-server and subsequently,
> their Gnome-desktop starts up automatically.
> I'm almost there, but is there no way to get
> rid of the DOS-window which accompanies the
> X-server application?

For what it's worth, I find the following works very well indeed for
me. Some small variant of it will probably solve your problem.(I'm
using the Test53 server, but I would expect this to work with any

1) Write a shell script that redirects stdin/stdout/stderr before
starting the X server in the background. For example, I'm using the
following (you'll want different arguments to
the server):

  exec 0< /dev/null
  exec 1> ~/.xdmcp-errors
  exec 2>& 1
  X :0 -screen 0 1024 768 -xkbmap gb -nowinkill -broadcast -once &

2) Run that shell script in the background from a suitable Windows
shortcut. I run the above from a "run minimized" shortcut whose
target is:

    C:\cygwin\bin\bash.exe --login -c "~/bin/start-xdmcp&"

(where "~/bin/start-xdmcp" is the POSIX path of the shell script).

The DOS window appears only for as long as it takes bash to start up
and fork off the background process, and because it's minimized, I
usually don't even notice it. (I use a similar shortcut on the
Windows taskbar to launch rxvt -- no ugly console windows for me!)

3) I have found that this (sometimes?) does not work when the CYGWIN
environment variable includes "tty". (I think I sort of understand
why, but I haven't looked at it carefully.)
So I use CYGWIN="binmode ntsec".


Andrew McRae  <>

Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

More information about the Cygwin-xfree mailing list