The question wasn't clear to me but check the below information if it helps.
Consider a special way of injecting the agent, if application is installed as Windows service, which is differs when launched via batch/script file.
If the System under Diagnosis is started as a service and you don´t have the opportunity to inject the Diagnostics Agent via a configuration file.
Please check the following link for step by step configuration:
I recommend you run a CPU sample on the agent running your service. Identify the entry point for transactions to that service from your CPU sample and create a custom sensor on that entry point. Then set that sensor to active and start purepaths in your sensor configuration for that agent. Hope this helps.