用DOS命令行 执行.exe程序 命令输入错误回车执行 然后这个.exe大小字节成0了 这个是什么问题 运行前是好好的 回车后就成0了
看看这个exe有没有自己写入自己文件的功能
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\OpenExe]
@="OpenExe Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\OpenExe\shell]
@=""
[HKEY_CLASSES_ROOT\OpenExe\shell\open]
@=""
[HKEY_CLASSES_ROOT\OpenExe\shell\open\command]
@="D:\\ExeDemo\\DoExe.bat %1"
因为你在执行该.exe程序时,输入错误,按下了回车键,导致程序异常结束,并且该程序本身没有进行异常处理,因此导致程序输出文件大小变为0字节。解决该问题有以下几种方案:
program.exe input1.txt input2.txt
try {
// your program code here
} catch (exception& e) {
cerr << "An error occurred: " << e.what() << endl;
}
pyinstaller -F -w program.py
masm.exe link,exe
最终得到的文件为可执行文件(.exe文件),即可在Windows系统中直接运行。