Product Documentation

To specify pre-launch and post-exit scripts

Dec 17, 2015

After testing a profile, if you determine that certain operations are required before or after running the application, you can write scripts and add them to the profile.

To specify these operations, from the Edit menu, select Profile Properties and use the Pre-launch & Post-exit Scripts page to select scripts. By default, you define scripts for a profile and all its targets.

If you determine that a target requires scripts that are different from the default for the profile, select Edit > Target Properties, and on the Pre-launch & Post-exit Scripts page, clear the Use profile scripts check box, and specify the scripts for the target.

On the Pre-launch and Post-exit Scripts page:

  1. Click Add Item next to Pre-launch scripts or Post-exit scripts.
  2. Choose whether or not to run the script within the isolation environment by clicking one of the option buttons Isolate script or Do not isolate script.
  3. Select the script you want to use.
  4. Specify any command-line parameters required by the script.
  5. Specify the order in which they run. The Offline Plug-in runs scripts in the order they are listed.

Pre-launch and post-exit scripts are commonly CMD files, but can be any file executable by Windows. You create pre-launch and post-exit scripts independent of the profiler. Valid file extensions are included in the PATHEXT environment variable, which shows a list of file extensions that are considered to be executable.

In addition to the default file extensions, add new file extensions, if needed, by adding them on the profiling workstation in the system variable PATHEXT. Complete these changes before you launch the profiler, or re-launch it to capture the updates. After you add them, they are read from the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment in the PATHEXT element.

For example, to copy dynamic files each time a user launches a certain application, create a VB Script or batch file that copies those files or runs a utility each time the application starts and exits.