L
L
LYTK42020-08-26 20:59:29
C++ / C#
LYTK4, 2020-08-26 20:59:29

How to run multiple instances of a program?

Here is my code, but it doesn't run:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace verigoboost
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 0;
            while (n < 5) {
                Thread.Sleep(1000);
                Process.Start("C:\\Steam\\steam.exe");
                n++;
            }
            Console.WriteLine("Все");
            Console.ReadKey();
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2020-08-26
@LYTK4

The program itself (Steam) resists running multiple instances of itself. She looks that there is already a running second copy, and immediately terminates itself. As a result, it seems that it does not start at all.
I think that with the calc.exe file (which is in the windows folder) everything will work out.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question