1
Answer

can i call .exe by using windows service? How?

anil maske

anil maske

6y
487
1
I want to call My Windows application in windows service periodically. if application is not running then only run windows application.
 
My code is 
 
string _sApplicationPath = "PATH OF EXE"
if (Process.GetProcessesByName("APPLICATIONNAME/PROCESSNAME").Length > 0) { return; }
else
{
Process myProcess = new Process();
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.FileName = _sApplicationPath;
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}
 
it work in windows application but not work in windows Service.
 
Help. 
Answers (1)