PDA

View Full Version : Wait on Process ID?


JC1455
04-12-2007, 08:30 AM
I see there is a new feature that I'd like to use. Wait now supports waiting on a running process. However you have to specify the process ID. My question is how can I determine the process ID for a process?

Our build machines start up, run the builds and then shut back down. Our IT runs full virus scans once a week. So after the appointed scan time passes the next time our build machine starts up it begins running the scan. I'd like to change our build script so that after it's done building it waits for the scan to complete before shutting down, but I don't know how to get the process ID so I can use the new wait feature.

Thanks for any suggestions.

kevina
04-12-2007, 12:50 PM
Attached is a small bld file that demonstrates what you are requesting.

This build demontrates retrieving the processID for a process not started by Visual Build Professional using WMI (see the FindProcesses Project script function).

Note that this function isn't needed for processes started by Visual Build Professional with a Run Program step since that action puts the ProcessID for the process in the RUNPROGRAM_PROCESSID temporary macro.

JC1455
04-12-2007, 12:56 PM
Thanks! That's exactly what I was looking for!