oztech Posted August 13, 2008 Report Share Posted August 13, 2008 I have a script which kills the Microsoft Word instances running on my Windows 2003 server. The problem is it kills all the instances, where as I want to keep the last instance or last microsoft word process as it is And kill the rest of the ones.Here is the code:FOR /F "tokens=2" %%I IN ('tasklist ^| Find "WINWORD.EXE"') DO CALL :windowlist %%I goto :EOF goto :EOF :windowlist echo %1TASKKILL /PID %1 /T goto :EOFHow can I achieve this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.