2017-07-13 294 views
0

我正在使用記事本++與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 

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; 

} 

但它確實不活躍,請給我一個幫助。非常感謝你!

+0

「main.bat」與給定的C++程序有什麼關係?它是編譯腳本嗎? – VTT

+0

@VTT我只是按照https://stackoverflow.com/questions/24761582/shellexecuteex-function-always-returning-error-code-5-c – vtrnnhlinh

回答

0

我的問題解決了!

我懷念的Visual C++可再發行2008年和2010年

版主請關閉我的話題。謝謝!

0

導航到C:\Program Files (x86)\Notepad++右鍵單擊Notpad ++。exe文件單擊屬性&下的兼容性Tab UN-TICK以管理員身份運行程序框DONE。 請參閱this link

+0

謝謝,但我的錯誤代碼是5,它是2.但是,謝謝你您的幫助! – vtrnnhlinh