Microsoft visual studio ошибка не удалось запустить программу

  • Remove From My Forums
  • Вопрос

  • Только начал обучение С++ по учебнику Страуструпа.
    Загрузил Visual Studio

    Начал со стандартного «Hello, World!» 

    Отладка проходит успешно, ошибок нет.

    Однако программа не запускается. 

    Выходят следующие сообщения:

    Следующий проект устарел: Hello, World — Debug Win32

    Не удается запустить программу: …/HelloWorld.exe
    Не удается найти указанный файл

    Что я делаю не так?

    Система: Wind x64.

Ответы

  • Книга нашего дорогого и горячо любимого Страуструпа написана о языке программирования, а не о работе в среде разработки Visual Studio. Последнее описано в справочной системе (в крайнем случае, есть сайт msdn.microsoft.com/library).
    Советую там ознакомиться с технологией создания проекта VC++ и процедурой преобразования исходного кода в исполняемый модуль.

    • Изменено

      20 ноября 2013 г. 5:37

    • Помечено в качестве ответа
      Maksim MarinovMicrosoft contingent staff, Moderator
      2 декабря 2013 г. 7:42

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, 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, 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, Unable to start program, Access is denied

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++.

Создаю проект: File > New > Project… > Empty Project

Создаю файл: File > New > File.. > C++ File

Пишу стандартную программу «Hello, world!»

#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
     cout << "Hello, world!" << endl;
     system("pause");
     return 0;
}

Жму ctrl+f5. Идёт построение, ошибок в коде нет, но выскакивает ошибка «не удаётся запустить программу «путь до exe файла» Не удаётся найти указанный файл.

Скриншот

Самого exe файла по этому пути нет, он даже не создаётся.

Буду признателен за вашу помощь.

PAMAC

0 / 0 / 0

Регистрация: 11.06.2010

Сообщений: 12

1

Не удаётся запустить программу после отладки

11.06.2010, 00:39. Показов 34508. Ответов 10

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

Добрый день!

Пытаюсь выполнить следующий код:

C++
1
2
3
4
5
6
#include <iostream.h>
 
void main()
{
    cout << "1 n";
}

Нажимаю F7
После жму F5

Далее появляется ошибка следующего содержания:
Не удаётся запустить программу «путь к exe»
Не удаётся найти указанный файл.

exe не создаётся. Пользуюсь Microsoft Visual Studio 2008

Что делать?



0



M128K145

Эксперт JavaЭксперт С++

8381 / 3613 / 419

Регистрация: 03.07.2009

Сообщений: 10,708

11.06.2010, 01:32

2

Написать код без ошибок

C++
1
2
3
4
5
6
7
#include <iostream>
 
int main()
{
    std::cout << "1 n";
    return 0;
}



0



0 / 0 / 0

Регистрация: 11.06.2010

Сообщений: 12

11.06.2010, 10:39

 [ТС]

3

Исправил. Всё-равно таже самая ошибка появляется….



0



Эксперт JavaЭксперт С++

8381 / 3613 / 419

Регистрация: 03.07.2009

Сообщений: 10,708

11.06.2010, 19:17

4

PAMAC, прикрепите проект в архиве к сообщению



0



0 / 0 / 0

Регистрация: 11.06.2010

Сообщений: 12

12.06.2010, 11:43

 [ТС]

5

вот..



0



M128K145

Эксперт JavaЭксперт С++

8381 / 3613 / 419

Регистрация: 03.07.2009

Сообщений: 10,708

12.06.2010, 12:44

6

Лучший ответ Сообщение было отмечено tezaurismosis как решение

Решение

PAMAC, сделайте ребилд проекта(в меню Build) и в проверка.cpp напишите первой строкой

C++
1
#include "stdafx.h"

И на будущее — не называйте проекты и файлы кириллицей



1



0 / 0 / 0

Регистрация: 11.06.2010

Сообщений: 12

13.06.2010, 01:34

 [ТС]

7

благодарю



0



0 / 0 / 1

Регистрация: 05.06.2013

Сообщений: 29

14.07.2013, 17:05

8

У меня такая же ошибка , помогите пожалуйста



0



banzay89

2 / 2 / 1

Регистрация: 21.05.2013

Сообщений: 129

13.02.2014, 13:41

9

TheCssForever,

Цитата
Сообщение от M128K145
Посмотреть сообщение

PAMAC, сделайте ребилд проекта(в меню Build) и в проверка.cpp напишите первой строкой

C++
1
#include "stdafx.h"

И на будущее — не называйте проекты и файлы кириллицей



0



Asix

0 / 0 / 0

Регистрация: 03.03.2013

Сообщений: 4

23.05.2014, 00:49

10

такая же проблема подскажите в чем может быть беда,1 курснеку мифи:

C++
1
2
3
4
5
6
7
8
9
10
#include<stdio.h>
#include<conio.h>
int main()
{
    printf("hello,worldn");
  
    _getch();
 
return 0;
}



0



2 / 2 / 1

Регистрация: 26.05.2015

Сообщений: 3

26.05.2015, 22:33

11

В проект файлы добавляются командой меню «Проект — Добавить новый элемент…». — мне помогло



0



Создаю проект: File > New > Project… > Empty Project

Создаю файл: File > New > File.. > C++ File

Пишу стандартную программу «Hello, world!»

#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
     cout << "Hello, world!" << endl;
     system("pause");
     return 0;
}

Жму ctrl+f5. Идёт построение, ошибок в коде нет, но выскакивает ошибка «не удаётся запустить программу «путь до exe файла» Не удаётся найти указанный файл.

Скриншот

Самого exe файла по этому пути нет, он даже не создаётся.

Буду признателен за вашу помощь.

  • Microsoft visual studio ошибка не удается найти указанный файл
  • Microsoft visual studio код ошибки 0x80070002
  • Microsoft teams код ошибки 80080300
  • Microsoft visual studio возникли ошибки сборки
  • Microsoft teams код ошибки 42b