Error using Windows Command Line Commands in TestStand

Updated Jan 9, 2023

Reported In


  • TestStand

Issue Details

Trying to execute Windows Command Line commands using the Custom Commands utility in TestStand fails and shows that the system cannot find the file specified:

​Error code:2 occured on command mkdir  


Using a special syntax the Custom Command tool does allow execution of Windows Command Line commands. 

You must include cmd.exe /c before all Windows Command Line commands you wish to execute.

For instance, to create a directory called Test at the path C:/Users/admin/Desktop from the Windows Command Line you would execute the line: 

mkdir "C:/Users/admin/Desktop/Test" 

To execute this same command from the Custom Command utility in the TestStand Deployment Utility Installer Options simply add cmd.exe /c to the beginning of the command as shown below: 

cmd.exe /c mkdir "C:/Users/admin/Desktop/Test" 

You must do this for each Windows Command Line command you wish to execute.