If the shelled task is a script itself then it can send it's own PID back to the parent using INI file or registry value.

If the SHELLed task (though you should probably be using RUN) is not a script then the parent script can search the process table for the PID.

For an example of how to do this see the EnumProcess() UDF: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Board=7&Number=83681