The VSPerfCmd.exe Detach option disconnects the profiler fromthe specified processes or all processes if none are specifed. Profiling must have been initialized by using the sampling method.
Profiling that was started with either the Launch or the Attach options can be disconnected with Detach. The profiler can be reattched by using subsequent Attach commands.
Detach does not close the profiling data file. Use the Shutdown option to end profiling and close the data file.
If the Start option was specified with the Crosssession option, any calls to VSPerfCmd /Attach or to VSPerfCmd /Detach must also specify Crosssession.
In this example, the Detach command suspends profiling and the Shutdown command closes the profiler data file.
VSPerfCmd.exe /Start:Sample /Output:TestApp.exe.vsp VSPerfCmd.exe /Launch:TestApp.exe ;REM Excercise the application VSPerfCmd.exe /Detach VSPerfCmd.exe /Shutdown