How can I parse and assign a PID to a variable
Posted on 2006-05-30
I want to create a dos batch that will allow me to run
C:\adplus.vbs -crash -pid <pid of process with highest mem usage>
I can run tasklist to get a list of the processes but I don't know how to parse the data and pass it into a variable.
C:\>tasklist /FI "IMAGENAME eq apache.exe"
Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
Apache.exe 2708 Console 0 3,924 K
Apache.exe 1952 Console 0 9,448 K
Thanks in advance.