_CONSOLEPIDS returns a space-delimited list of the process IDs of all processes attached to this console.

 

Example:

 

echo %_consolepids

19544 34752