Visual studio 2022 unable to start program the system cannot find the file specified

I am having a similar issue as this post. However, on build I have 0 errors, 0 warning, and 0 messages.

I took a look at Project -> Properties but I do not seem to have a linker option (which appears to be a typical fix that others have used to solve this issue).

I have also tried Rebuilding Solution and then running but that does not seem to work either...

Visual studio 2022 unable to start program the system cannot find the file specified

Based on the aforementioned similar issue I understand the premise that "when an exe cannot be created (or in my case - found)... then naturally it cannot be run as it does not exist". However, I do not understand where the disconnect is occurring that is preventing this file from either being found or created...

Any help sorting this out would be greatly appreciated. Cheers.

Visual studio 2022 unable to start program the system cannot find the file specified


If you don't want to see the message in the popup
dialog that you used in the Subject of this thread,
then stop trying to run a program before it has been
built successfully.

If the compile fails, no object file (*.obj) will be
created so the link step will fail. If the compile
is successful and an obj file is created, but the link
step fails for some other reason - such as not being
able to find a lib file as in the case shown in your
pic - then an exe will not be created.

When an exe cannot be created because of compile and/or
link errors, then naturally it can't be run as it doesn't
exist. I suggest you stop trying to run all the time,
relying on implicit building, and start doing an explicit
Build (F7) or Rebuild. Fix all errors shown in the Build
Output - and preferably fix all Warnings as well - and only
then try to Run the program.

The Link error in the image you posted is sufficiently
explicit that you should be able to resolve why the
Linker can't find the .lib specified.

  • Wayne

While using Visual Studio in Windows 11/10, if you get Unable to start programThe system cannot find the file specified error; try solutions to get rid of the issue. There could be several reasons why this error might occur on your computer. This article explains some of the common causes along with solutions to troubleshoot the issue within moments.

Visual studio 2022 unable to start program the system cannot find the file specified

To fix Unable to start program, The system cannot find the file specified error in Visual Studio, follow these steps:

  1. Restart Visual Studio
  2. Verify the project file
  3. Run as administrator
  4. Add exclusion in antivirus
  5. Reset Visual Studio

To know more about these steps, keep reading.

1] Restart Visual Studio

At times, it could be a glitch or bug which is causing such an issue on your computer. In most cases, such problems get resolved when you restart the computer. However, in this situation, you need to restart the Visual Studio application. Whether you have an open project or not, you can easily restart this program on your computer. If you have an opened project on your screen, you can save everything and then do as said. Once done, you might be able to use all the options as usual.

If it doesn’t do anything positive, you can follow the subsequent tips and tricks.

2] Verify the project file

Let’s assume that you have deleted the project file from the respective directory after opening it in Visual Studio. It may have happened by mistake. If so, there is a very high chance of getting such an error on your computer. That is why it is highly recommended to verify if the project files are intact or not.

If yes, you can follow the other solutions. However, if there is some issue, you need to rectify it first. In some cases, you might need to recover the deleted project files in order to troubleshoot the aforementioned issue.

3] Run as administrator

Visual studio 2022 unable to start program the system cannot find the file specified

There could be times when you might need to run the Visual Studio with administrator privileges in order to compile a program or debug it. In general, administrator permission may not be required. However, if the aforementioned error appears, it is better to run the program with administrator permission.

To run Visual Studio as an administrator, follow these steps:

  • Click on the Start Menu.
  • Search for visual studio.
  • Right-click on the corresponding search result.
  • Click the Run as administrator option.
  • Click on the Yes button in the UAC prompt.

Following that, check if it resolves your issue or not.

4] Add exclusion in antivirus

If the project file is flagged by the antivirus, it may have been quarantined already. If so, you cannot use those files even though they are opened on Visual Studio. That is why it is recommended to check if your project files have been flagged by your antivirus or not. If yes, you need to add an exclusion for those files in your antivirus app. If you use Windows Security, you can follow this guide to add a folder to the exclusions list.

Related: Visual Studio, Unable to start program, Access is denied

5] Reset Visual Studio

Visual studio 2022 unable to start program the system cannot find the file specified

If you have changed a lot of things incorrectly, this error could appear on your computer. That is why follow these steps to reset Visual Studio in Windows 11/10:

  • Click on the Tools menu.
  • Select the Import and Export Settings.
  • Choose the Reset all settings option.
  • Click the Next button.
  • Choose the No, just reset settings, overwriting my current settings option.
  • Click the Next button.
  • Click the Finish button.

Then, check if it has solved your issue or not.

Read: Visual Studio Installer is stuck on Downloading

How do you fix The system cannot find the file specified?

To fix The system cannot find the file specified error in Visual Studio, you can follow the aforementioned solutions. It appears mainly because of the antivirus blocking your project file. However, at times, it could appear due to the lack of administrator credentials as well.

Read: Visual Studio, Unable to start program, Access is denied

What does The system cannot find the file specified mean?

The system cannot find the file specified error implies that Visual Studio could not recognize the project file or the executable file in the predefined directory. It may appear due to corrupt project files, antivirus, firewall, etc. If you see this issue on your computer, you can follow these solutions to troubleshoot it within moments.

That’s all! Hope this guide helped.

Read: Fix error 0x80070666 when installing Microsoft Visual C++.

How do I fix the system Cannot find the file specified Visual Studio?

To fix Unable to start program, The system cannot find the file specified error in Visual Studio, follow these steps:.
Restart Visual Studio..
Verify the project file..
Run as administrator..
Add exclusion in antivirus..
Reset Visual Studio..

How do I fix lnk1168 error?

To fix this issue, verify that the filename file handle is not locked, and that you have write permission for the file. If it is an executable, verify that it is not already running. You can use the Windows SysInternals utilities Handle or Process Explorer to determine which process has a file handle lock on filename .

How do I create a C++ project in Visual Studio?

To create a C++ project in Visual Studio.
From the main menu, choose File > New > Project to open the Create a New Project dialog box..
At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Console..
From the filtered list of project types, choose Console App then choose Next..

How do I use Solution Explorer in Visual Studio?

By default, the Solution Explorer tool window appears as a pane in the upper-right side of the Visual Studio integrated development environment (IDE). If you don't see the Solution Explorer tool window, you can open it from the Visual Studio menu bar by using View > Solution Explorer, or by pressing Ctrl+Alt+L.