Running an app that requires an administrator account from a service

Posted by Bergvall on Stack Overflow See other posts from Stack Overflow or by Bergvall
Published on 2010-12-29T07:22:58Z Indexed on 2010/12/29 7:53 UTC
Read the original article Hit count: 178

Filed under:
|
|
|

Is it possible to run handle.exe (from sysinternals) from a service (in windows7) without having to turn off UAC?

The service is a custom c-app that needs to find out which process is locking a file it tries to access and handle.exe seems to be a good way to solve it but i can't get it to work with UAC turned on. This app runs all the time so i can't have a UAC prompt while its running but its fine if it shows up at startup.

Handle.exe works fine from an admin commandprompt but fails when trying to run from a normal prompt.

I call handle.exe from CreateProcess() and get the output from pipes. I guess there should be a way to solve this but i can't figure it out. Setting up the service to log in from an admin account does not seem to work.

© Stack Overflow or respective owner

Related posts about c

    Related posts about windows-7