Windows reports "The system cannot execute the specified program" error


Problem : Executable built in Microsoft* Visual Studio* 2005 SP1 (with whatever compiler) on one machine can't run on another machine with Visual Studio 2005 installed.  Windows reports "The system cannot execute the specified program" error when running the executable.  This article may also apply to systems with other versions of Visual Studio installed.


Environment : Windows with Visual Studio installed.


Root Cause : No DLLs with proper manifest (that matches the executable's requirement) are found on target machine.


Resolution : Download and install proper version of Microsoft Visual C++ Redistributable Package on target machine.  It can be found on Microsoft website.  In this case, you need to install Microsoft Visual C++ 2005 SP1 Redistributable Package.  Alternatively, build your application statically.
For more complete information about compiler optimizations, see our Optimization Notice.