【问题标题】:ShellExecute - ERROR code 5ShellExecute - 错误代码 5
【发布时间】:2017-12-17 17:12:41
【问题描述】:

我正在使用带有 TDM-GCC 的 Notepad++。我的电脑是 2Gb RAM Windows 10 32 位 3.30 GHz。当我执行我的简单程序时,它显示错误。

Access is denied.
An attempt was made to execute the below command.
Command: D:\Deane\Github\CPP_Projects\AnalysisName\main.bat
Arguments:
Error Code: 5

Image of the error

我关注这个:ShellExecuteEx function always returning error code 5 (C++)

程序代码(如有必要):

/* AnalysisName Program - written by Vo Tran Nha Linh */

#include <iostream> // Input and Output library.
using namespace std;

int main()
    {
    string name;
    cout << "Hello friend! It's nice to meet you, what is your name?" << endl;  // Ask the name.
    cin >> name; // Input name.
    cout << "Hello " << name << ". Your name is interesting." << endl; // Have a greeting.
    cout << "Your name has " << name.length() << "letters." << endl; // Show the name's length.
    cout << "It starts with " << name.front() << "letter." << endl; // Show the first letter of the name.
    cout << "It ends with " << name.back() << "letter." << endl; // Show the last letter of the name.

    return 0;

}

但它没有激活,请给我帮助。非常感谢!

【问题讨论】:

  • main.bat 与给定的 C++ 程序有什么关系?是编译脚本吗?
  • 代码 5 - 拒绝访问意味着您没有使用标准用户权限运行程序的权限。

标签: c++ notepad++ tdm-gcc


【解决方案1】:

我的问题解决了!

我想念 Visual C++ Redistributable 2008 和 2010。

版主请关闭我的话题。谢谢!

【讨论】:

    【解决方案2】:

    导航到C:\Program Files (x86)\Notepad++ 鼠标右键单击 Notpad++.exe 文件单击属性并在兼容性选项卡下 UN-TICK 以管理员身份运行程序框完成。 参考this link

    【讨论】:

    • 谢谢你,但我的错误代码是 5,它是 2。不过,谢谢你的帮助!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-29
    • 2017-06-03
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 2015-04-15
    • 2017-06-30
    相关资源
    最近更新 更多