This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Many Cygwin (mintty) windows - How to close all?

Arun Biyani <> writes:

> Chris Sutcliffe wrote:
>>>> Is there some sort of Cygwin command that -
>>>> 1. Closes all Mintty windows
>>>> 2. Unloads services - such as cron
>>>> 3. Exits X server
>>>> in short, gets rid of all Cygwin processes so I can update & restart
>>>> without having to do all this myself.
>>> I use the attached script (run it elevated on Vista and above) before
>>> updating with setup. This is only tested on Vista.
>> Doing a 'kill -9 -1' works for me in terms of getting rid of all my
>> mintty windows at once.  I'm not sure if it will kill services and
>> exit the X server as well.
>> Chris
> Thanks for the suggestions.
> Arun

Or you may want to check out

The following 2 files can do the job you thus wanted:
together with

The C# .net programming provides a `System.Diagnostics' package, which
you can use to enum every process and every PE32 executable (dll or exe)
loaded by each process, then you just grep "cygwin1.dll" and
TerminateProcess each of them. Put it in a python script...

You can terminate all notepad.exe with ` notepad.exe'
for example.

Another thing, when running `', the python must be the
native win32 python, with pywin32 installed, not the one shipped with
cygwin. The reason should be apparent. Then there comes another problem,
you must run it like
    "c:/python25/python q:/bin/windows/ notepad.exe"
which is too boring

So, I just wrote a bash helper that will make it possible to invoke
native python from the shebang like:

    #!/bin/env pywinstart.exe

the pywinstart.exe is a *general* .exe file, which will only invoke bash
with a `' and the command line arguments, in, it will
see pywinstart.exe is executing, so instead it will invoke a
**, which then *cygstart* the native python, with the .py
file path "~/bin/windows/" transformed to it's win32
path using `cygpath -alm'

If you are interested, consider checkout the whole

and execute its bin/windows/ and
bin/windows/, and reboot. See what happens...

Be fore-warned: it will change your keyboard's CapsLock into Control,
among other not very polite things:-)

> --
> Problem reports:
> FAQ:         
> Documentation:
> Unsubscribe info:

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]