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()2番目のプロセスを起動する前に最初のプロセスを完了する必要があるので、両方を起動するバッチファイルを作成し、.exeにバッチファイルを起動させました。

于 2012-07-13T06:31:56.590 に答える