I have an application that is launched from within a service using a local administrator account. This application is accessible by a web browser and the host PC can be shut down through this interface.
If a user is logged into the host PC and I browse to it and shut it down, the application exits and shuts down the PC as I would expect - using ExitWindowsEx() (with the shutdown priviledge enabled).
If, however, the PC is logged off, I browse to it - the application still running within the service, and attempt a shutdown using ExitWindowsEx(), it returns successful and the appears to be no problem but the PC never shuts down.
I have also tried InitiateSystemShutdown() which bizzarely fails and returns error 2! (The system cannot find the file specified).
It doesn't seem to matter what account I use to launch the application with.
Any help would be greatly appreciated!
Thanks.