|I want to run a batch file to look foran EXCELprocess that may be in a hung state on a server. So far, I am working with PSLIST from the Sysinternals. I can run that and save to a txt file, and I may have a line like this:|
Name Pid Pri Thd Hnd Priv CPU Time Elapsed Time
EXCEL 1436 8 4 269 11084 0:00:05.171 5:57:05.221
I know how to get that 1436 into a variable. And I suppose even if it were 936, no problem. My concern is that I presume it could be 5 digets. Maybe I should just start assuming up to 5 and pull it. But I thought I'd ask if anyone knows of a tool to specifically pull lthe PIDS if I know the name of the process. In this case I may have 4 EXCEL processes running, and one hung. If for example, it is over a certain length of time, I plan to kill it.