SysAdmin's, How to Get Process ID on Windows?
I'm converting a linux shell script into a Windows batch file and I'm having a hard time figuring out how to return the process ID of a program I just launched. I run this program in an infinite loop in the batch script so I need to get the process ID right after I launch it to keep track of which pid is with which session (so dumping tasklist won't work).
Unix Example:
java -jar Keywords.jar &
echo $!
On Linux $! is the pid. This is being launched from a batch file so how can I capture the pid on a Windows environment right after I launch?
WG
__________________
I play with Google.
|