So I already know how to run two batch commands in parallel like so
start /b cmd /c command1
start /b cmd /c command2
Now I would like to create a Windows service that does the same thing, however I don't think I can just make a service that directly runs these two commands, as stopping the service would not kill the background processes that the service created.
My service I want to make needs to run command1
and command2
in parallel (fire command1
first, then command2
while command1
is still running) and when the service stops, both (all) of the associated processes should also stop.
I also want to avoid having to write some Python/C# program or something and do it directly from Windows/Batch/Powershell scripting if possible.