locked
How to call a Windows Application from a Windows service RRS feed

  • Question

  • How to call a Windows Application from a Windows service?

     

    I put it in the OnStart  mehot but it didn't work:

     

    Code Snippet

     

    System.Diagnostics.Process proc = new System.Diagnostics.Process();

    System.Diagnostics.ProcessStartInfo inf = new System.Diagnostics.ProcessStartInfo();

    inf.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;

    inf.FileName = "WindowsApplication3.exe";

    proc.StartInfo = inf;

    proc.Start();

     

     

     

     

    thanks

     

    Ed

     

     

     

    Tuesday, February 12, 2008 9:59 PM

Answers

  • A thought...  Try specifying the fully qualified path to the executable.

     

    Also, take into consideration the security context the service is running under.  Does it have the rights to launch an application?

     

    J

    Wednesday, February 13, 2008 6:06 AM

All replies

  • A thought...  Try specifying the fully qualified path to the executable.

     

    Also, take into consideration the security context the service is running under.  Does it have the rights to launch an application?

     

    J

    Wednesday, February 13, 2008 6:06 AM
  •  

    Place the "WindowsApplication3.exe" in "C:\Winodws\" or in "C:\Winodws\System32"  folder then its will work
    Wednesday, February 13, 2008 6:11 AM