This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here

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.


VSPerfCmd.exe /Start:Method /Output:FileName[Options] /StartWait[:Seconds]  


The number of seconds to wait before returning from the Start sub-command.

Required Options

The WaitStart option can only be used with the Start sub-command.

Output: filename
Specifies the output file name.



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  
@echo Could not start Profiler!  
@echo Error %errorlevel%