This is the mail archive of the
mailing list for the Cygwin project.
Re: Many Cygwin (mintty) windows - How to close all?
Arun Biyani <firstname.lastname@example.org> 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.
> Thanks for the suggestions.
Or you may want to check out
The following 2 files can do the job you thus wanted:
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 `terminateModule.py notepad.exe'
Another thing, when running `terminateModule.py', 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/terminateModule.py 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:
the pywinstart.exe is a *general* .exe file, which will only invoke bash
with a `helper.sh' and the command line arguments, in helper.sh, it will
see pywinstart.exe is executing, so instead it will invoke a
*pywinstart.sh*, which then *cygstart* the native python, with the .py
file path "~/bin/windows/terminateModule.py" transformed to it's win32
path using `cygpath -alm'
If you are interested, consider checkout the whole
and execute its bin/windows/after-check-out.sh and
bin/windows/startup.sh, 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: http://cygwin.com/problems.html
> FAQ: http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple