Run .exe from Windows Service

1

I am trying to open an application from a Windows service but it does not run. I am using Process.Start(Path); but it does not work for me.

I use Visual Studio 2015 - C #

    
asked by Oscar Huaman 29.08.2018 в 00:13
source

2 answers

0

Probably the task is running, but you will not see it because by default the services are executed under the SYSTEM account.

Try the following:

  • Edit the service that the app invokes. Go to the "log on" tab and select "This account". Enter your username and password.

  • To and restart the service.

  • Obviously this has the limitation that you have to know a user and password of the user who will need the service.

    Also, it will not "work" for multiple users.

        
    answered by 29.08.2018 в 11:51
    -1

    In principle it is not possible to start an application from a Windows service.

    Windows services do not run in the context of any specific user, and do not allow any interaction with the user (they can not show a form, for example).

    Depending on why and what type of application you want to launch, you may be able to look for an alternative solution. But in no case will it be as simple as a Process.Start .

    P.D. this is so if I'm not wrong starting in Windows Vista. In previous versions if possible.

        
    answered by 29.08.2018 в 09:13