2

I'm trying to write a small program that just runs two executables. Currently it only runs the first one for some reason:

#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");
}

It's just a small program to run Diablo II + a BorderlessWindow program.

4

2 回答 2

3

这将完成任务

#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
}
于 2012-07-13T05:31:21.127 回答
1

好吧,因为system()要求在启动第二个过程之前完成第一个过程,所以我刚刚创建了一个启动两个的批处理文件,并让 .exe 启动批处理文件。

于 2012-07-13T06:31:56.590 回答