How to run exe from the (Session 0 Isolation) service

Asked 2 years ago, Updated 2 years ago, 75 views

I am currently using VisualStudio 2015 to create a Windows service, and I would like to monitor a directory and have an exe file run if a PDF file is generated under it.

However, at this stage, when I start the service, nothing happens on the screen and
Task Manager confirmed that it was running in the background.

The cause was found to be "Session 0 Isolation" and
while referring to the site below. It is currently being improved, but it says, "Set the session of the logon user to a duplicate token." What exactly should I do?

I have just started C#, and I would appreciate it if you could let me know if you have time.
Thank you for your cooperation.

reference site:
Launch the GUI process from Windows Services

c# windows windows-services

2022-09-30 21:28

1 Answers

The English version of StackOverflow has a Q&A that matches your requirements.
Start a Windows service and launch cmd
https://stackoverflow.com/questions/4147821/start-a-windows-service-and-launch-cmd
Of these, DuplicateTokenEx() is probably the correct action.

I'll give you a similar article in C language but similar.

IPA ISEC Secure Programming Course 8-2. Interprocess Communication and Backdoor https://www.ipa.go.jp/security/awareness/vendor/programmingv1/b08_02.html

Generating a Process from a Service column for Implementing EternalWindows Services/Services
http://eternalwindows.jp/windevelop/service/service05.html


2022-09-30 21:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.