The WaitStart option causes the VSPerfCmd.exe Start sub-command to return only when the profiler has initialized or when the specified number of seconds has passed. By default, the Start command returns immediately. If the Start sub command returns without initializing the profiler, an error is returned. If the number of seconds is not specified, the Start command waits indefinitely.
The WaitStart option is useful in batch files to insure that profiler has been initialized.
In this batch file example, the Start command will wait for 5 seconds for the profiler to initialize.
VSPerfCmd.exe /Start:Sample /Output:TestApp.exe.vsp /WaitStart:5 if not %errorlevel% 0 goto :error_tag VSPerfCmd.exe /Launch:TestApp.exe goto :end :error_tag @echo Could not start Profiler! @echo Error %errorlevel% :end