简体   繁体   中英

How to switch to the Desktop of Windows Service

I created a windows service and marked the CheckBox "Allow service to interact with desktop" in "Log On" tab of service properties. The service opens a windows application (.exe) but I don't know that what is the progress of the opened .exe. Is there a way that I could switched to the desktop of the service?

The service "logged on as" is "Local System"

(I am sure that the .exe is opened by the service because when I try to modify/move/delete, the message is returned that it is being used by another process)

Services do not have a desktop, so you can't switch to it. They might have very limited Windows-version-dependent access to a user's desktop, but you can't count on it and shouldn't use it.

Also, if you're running terminal services in a version of Windows that can do desktop I/O and the service is configured for it, the I/O goes to the first desktop. If that's not you, you won't see it.

I am sure that the .exe is opened by the service because when I try to modify/move/delete, the message is returned that it is being used by another process

You would need to stop the service before you can move/delete/replace the exe.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM