Skip to end of metadata
Go to start of metadata

Sometimes it is neccessary to get the PID of the currently running task (job). The program getParentId is provided for this. You can download the program here:

Please unzip to any location. You will find the exe file getParentId.exe. Executing this file results in the PID being logged to stdout. Here is an example job that sets an environment variable PID with the pid.

This program is presently working on 32 bit systems only.

 <job  name="job7">
     <script  language="shell">
 c:\temp\getParentId >
 set /p PID=<
 echo pid= %PID%
     <run_time />

A good idea is to put this code snippet into a file, e.g. getpid.cmd, that can be included in any shell job by using the include function of JobScheduler.

Write a comment…