I need my windows service developed using C# to restart another windows service or process (a process that belongs to the system not written by me like the taskmgr.exe for example)
how could that be possible within the code of my service ?

In other words : my service need to invoke another process to be run, and if it is already running then restart it .:-/

please urgent help is appreciated
thanks in advance

Let WS1 checks the status of WS2 and use switch\case

ServiceController sc = new ServiceController("WS2");

switch(sc.Status)
{
case Status.Start:
......
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.