none
Unable to start program... The system cannot find specified path

    Question

  • Hello I am using Windows 7 64 bit.
    Visual Studio 2010 ultimate.
    I am getting this error "Unable to start program... <folder path> The system cannot find specified path"

    Please suggest me solution

    Tuesday, August 6, 2013 1:18 PM

Answers

  • If I were troubleshooting this, here's how I'd go about it.

    First of all, what kind of project are you making?

    I'll assume you are building and debugging a Visual C++ project.  i.e. vcxproj.

    1. Go to Project > Properties > Configuration Properties > Debugging 
    2. Check the value of Command, which is normally $(TargetPath).  If not, then make sure it is something reasonable.
    3. The target path is specified in Configuration Properties > Linker > General > Output File, and is usually $(OutDir)$(TargetName)$(TargetExt)  If it's not, then make sure it is something reasonable.
    4. Back in Configuration Properties > Debugging > Command, edit the command (click drop-down and choose <Edit...>
    5. Click the Macros>> button and type $(TargetPath) in the lower edit box to search for $(TargetPath) (or just scroll down to $(TargetPath).  Examine the value and make sure it is something reasonable and that the file exists on disk.
    6. Did your build succeed?  Clean and Rebuild your solution and check for build errors.  The final output must build correctly before you can debug the exe.

    If everything seems to be in order, then

    1. check to see what your exe depends on.  Make sure that any dependent dlls are present in the working folder.
    2. You can double check that the working working directory is the same as the one the target is in by specifying Configuration Properties > Debugging > Working Directory to $(TargetDir).
    3. "Depends" will show you what dlls you depend on.  Make sure you have the right debug/release and 32-bit vs 64-bit versions of everything installed.
    4. If all else fails, then you can run ProcessMonitor and see what file the process is trying to open just before it fails.  This will tip you off as to the name of a missing dll or something.

    • Edited by Wyck Tuesday, August 6, 2013 3:47 PM started out with half a thought. oops.
    • Marked as answer by Carl CaiModerator Monday, August 12, 2013 10:04 AM
    Tuesday, August 6, 2013 3:46 PM

All replies

  • If I were troubleshooting this, here's how I'd go about it.

    First of all, what kind of project are you making?

    I'll assume you are building and debugging a Visual C++ project.  i.e. vcxproj.

    1. Go to Project > Properties > Configuration Properties > Debugging 
    2. Check the value of Command, which is normally $(TargetPath).  If not, then make sure it is something reasonable.
    3. The target path is specified in Configuration Properties > Linker > General > Output File, and is usually $(OutDir)$(TargetName)$(TargetExt)  If it's not, then make sure it is something reasonable.
    4. Back in Configuration Properties > Debugging > Command, edit the command (click drop-down and choose <Edit...>
    5. Click the Macros>> button and type $(TargetPath) in the lower edit box to search for $(TargetPath) (or just scroll down to $(TargetPath).  Examine the value and make sure it is something reasonable and that the file exists on disk.
    6. Did your build succeed?  Clean and Rebuild your solution and check for build errors.  The final output must build correctly before you can debug the exe.

    If everything seems to be in order, then

    1. check to see what your exe depends on.  Make sure that any dependent dlls are present in the working folder.
    2. You can double check that the working working directory is the same as the one the target is in by specifying Configuration Properties > Debugging > Working Directory to $(TargetDir).
    3. "Depends" will show you what dlls you depend on.  Make sure you have the right debug/release and 32-bit vs 64-bit versions of everything installed.
    4. If all else fails, then you can run ProcessMonitor and see what file the process is trying to open just before it fails.  This will tip you off as to the name of a missing dll or something.

    • Edited by Wyck Tuesday, August 6, 2013 3:47 PM started out with half a thought. oops.
    • Marked as answer by Carl CaiModerator Monday, August 12, 2013 10:04 AM
    Tuesday, August 6, 2013 3:46 PM
  • If you click 'Next' after File>New Project and select "Create Empty Project" then there are no files in the beginning, and you add them manually. It will build fine, but won't run. You need to add it to the source files list in the pane at right.

    If you have already created and saved the file, then in the "Solution Explorer" pane at right, right click on "Source Files" and choose "Add existing". Then add the file. You'll find it displayed in the list below afterwards. Now it will link and run. If you have just created the empty project and have no files yet, then it's better to rightaway right-click on Source Files, and choose "Add new", and then begin writing your code.

    This is especially confusing since this issue did not arise in old versions of VC++, and a person who is simply following a standard Windows programming book (Such as Charles Petzold's classic work) will find the instructions in the book apparently broken, even though the book is published by Microsoft Press itself, and is considered a VC++ coding Bible.
    • Proposed as answer by cygnus_seven Friday, December 27, 2013 11:10 AM
    Friday, December 27, 2013 11:10 AM
  • I can't find it
    Wednesday, September 26, 2018 1:10 AM