使用system()运行两个可执行文件
Run two executables with system()
我正在尝试编写一个只运行两个可执行文件的小程序。目前,由于某种原因,它只运行第一个:
#include <windows.h>
#include <iostream>
using namespace std;
main(){
cout << "Running Borderless Window..." << endl;
system("BorderlessWindowed.exe");
cout << "Running Diablo II MultiRes..." << endl;
system("D2MultiResGame.exe.lnk");
}
这只是一个运行暗黑破坏神II+无边界窗口程序的小程序。
这将完成任务
#include <windows.h>
#include <iostream>
using namespace std;
main(){
cout << "Running Borderless Window... and Diablo II MultiRes" << endl;
system("cmd /c start BorderlessWindowed.exe&&D2MultiResGame.exe.lnk");
// this is what i have tried
// system("cmd /c start notepad.exe&&mspaint.exe");
// which starts notepad and mspaint one after another
}
好吧,因为system()
要求在启动第二个进程之前完成第一个进程,所以我只创建了一个启动这两个进程的批处理文件,并让.exe启动批处理文件。
相关文章:
- 使用 make 编译多个可执行文件
- 具有多个可执行文件和依赖项的生成文件
- CMake 项目结构:如何正确地将库合并在一起并将它们包含在多个可执行文件中
- 如何使用gnu_parallal以运行多个可执行文件和/或bash脚本
- 我需要制作多个可执行文件来针对不同的指令集吗
- 如果可执行文件在两个或多个节点上运行,为什么它不能看到环境变量?
- IPC通过两个不同的可执行文件
- 是否可以使用C++中的一个make命令,用两个不同的gcc版本编译两个不同可执行文件
- 使用system()运行两个可执行文件
- CMake fixup_bundle多个可执行文件
- C++处理多个可执行文件的公共参数
- C++:创建一个包含两个可执行文件的makefile?C++
- 比较从相同源代码生成的两个可执行文件的校验和
- 在c++中创建两个可执行文件的Makefile
- CMake:使用静态库在一个项目中构建多个可执行文件
- 当我包含一个共享库时,我的可执行文件正在寻找它的两个版本
- Makefile改进:几个可执行文件和目录
- 用户界面-如何在C++中将gui与逻辑分离(通信2个可执行文件所需的模式和库)
- 如何使用 cmake 使用不同的编译器构建多个可执行文件
- 在CMake中添加多个可执行文件