我正在使用記事本++與TDM-GCC。我的電腦是2Gb RAM Windows 10 32位3.30 GHz。當我執行我的簡單程序時,它顯示錯誤。ShellExecute - 錯誤代碼5
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
我遵循這個: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++程序有什麼關係?它是編譯腳本嗎? – VTT
@VTT我只是按照https://stackoverflow.com/questions/24761582/shellexecuteex-function-always-returning-error-code-5-c – vtrnnhlinh