While the bat file is running, you can go into TASK MANAGER and see the process ID.
To do this:
1) Launch BAT file
2) Launch Task MAnager (CTRL-ALT-DEL --> Task MAnanger)
3) Click the Proccesses tab
4) Look for you bat file...(it should be listed) PID column = Process ID.
Or you can use TLIST (Resource kit util from a command line)
Thanks for replying. I'm looking to obtain the process id within the batch. I want to set a variable in the batch file to the process id. In UNIX it's a snap: jobid=$$ This is proving to be a problem in NT.
<pattern>
The pattern can be a complete task
name or a regular expression pattern
to use as a match. Tlist matches the
supplied pattern against the task names
and the window titles.
-m <pattern>
Lists all tasks that have DLL modules loaded
in them that match the given pattern name
-s
Show services active in each process.
-p <processname>
Returns the PID of the process specified or -1
if the specified process doesn't exist. If there
are multiple instances of the process running only
the instance with the first PID value is returned.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.