Subject: Re: Alive processes, tlist (tasklist) and kill
From: [email-masked] (Patrick J. Fay)

3 Oct 1998 18:29:42 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: [email-masked]
Cc: [email-masked]

Hello Ian,
Sergey has a 'ps' command on his webpage. My version of it
seems to dump core and I have a another alternative:
One way to get the basic equivalent of unix's 'ps' output is to use
the 'tlist.exe' from Microsoft's SDK.  I think Microsoft calls this
the Internet Resource Kit which you can get from:
 http://www.microsoft.com/ntworkstation/default.asp
then
 Downloads (left hand side bar)
Then scroll down to
 Internet Resources for Windows NT 
This is pretty huge for just the tlist.exe (which you will have to
build, probably with a MS C compiler (or mingw32?). The source is
simple (in dir /your_install_dir/samples/sdktools/tlist) and displays:
C:\>tlist
  -2 Idle.exe
   2 System.exe
  20 smss.exe
  30 csrss.exe
  34 WINLOGON.exe
 128 mgactrl.exe       MGACtrl
 132 mstask.exe        SYSTEM AGENT COM WINDOW
 102 NDDEAGNT.exe      NetDDE Agent
 169 explorer.exe      Program Manager
 173 mdm.exe           OleMainThreadWndName
 179 systray.exe       Battery Meter
 181 mgaqdesk.exe      MGA QuickDesk
 188 pwstray.exe       OleMainThreadWndName
 190 REMINDER.exe      OleMainThreadWndName
 192 MSOFFICE.exe      Microsoft Office Shortcut Bar
etc.
You can grep this list for the tasks you are looking for.
The same directory has a 'kill' program:
C:\ms_sdk\samples\sdktools\tlist>.\kill /?
Microsoft (R) Windows (TM) KILL
Copyright (C) 1994-1996 Microsoft Corp. All rights reserved

usage: KILL [options] <<pid> | <pattern>>

           [options]:
               /?     This help

               /f     Force process kill

           <pid>
              This is the process id for the task
               to be killed.  Use TLIST to get a
               valid pid

           <pattern>
              The pattern can be a complete task
              name or a regular expression pattern
              to use as a match.  Kill matches the
              supplied pattern against the task names
              and the window titles.

If you wanted a gnu-win32 solution, this isn't it. Maybe someone
can compile the source and post it somewhere. I'm not sure of the
legal issues or I'd do it.
Hope this helps,
Pat

Patrick Fay, Ph.D., Intel Corp.            email:   [email-masked]
Los Alamos National Lab                    wk:         (505) 665-9141
TA3,Bldg 132, MS B272                      fax:        (505) 665-6333
Los Alamos NM 87545    ASCI-RED http://www.acl.lanl.gov/~pfay/teraflop

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".