This is pretty simple.

Create a batch file, call it app-pool-pid.bat for instance.

Edit it and add the following lines into the file:

@echo off

cscript.exe c:\windows\system32\iisapp.vbs

pause