2
Answers

Run an executable file from windows service

Zalak Parikh

Zalak Parikh

5y
988
1
I created a windows service with Process.start(filepath) in it. But it is neither working nor showing any errors. I got the file as a background process in the task manager.

I tried BackgroundWorker with DoWorkEventHandler delegate to start the process. But I failed to start the process.

I also tried with ProcessStartInfo and UseShellExecute as false but it is not working.
  1. Process prs = new Process();
  2. string strAppPath;
  3. strAppPath = "C:\\WINDOWS\\SYSTEM32\\notepad.exe";
  4. prs = Process.Start(strAppPath);
  5. prs.WaitForExit();
  6. base.Stop();
Answers (2)