Jump to content

autoit not executing as the logged on user


ant2ne
 Share

Recommended Posts

Basically, I'm writing an autoit exe that runs as a service. As such, since it is executed as "System" I think the program thinks that the logged on user is "System". I need to execute some things on the logged on users @appdata and registry, but the program tries to execute this stuff on "System's" @appdata and registry. Any advice on how to make these things run as the logged on user? Or make it execute on the logged in user?

Please, do not reply asking my why I'm running this as a service or any other such nonsense that is not an answer to my question.

Link to comment
Share on other sites

Running it as a service really prohibits it from doing certain things. To check if it really is executing as system you can look in task manager or add MsgBox(0,"AppData Path",@Appdata) to your code near the beginning. As for running as the user you could run a launcher a service and use RunAs() to run your actual script if need be.

Link to comment
Share on other sites

Running it as a service really prohibits it from doing certain things. To check if it really is executing as system you can look in task manager or add MsgBox(0,"AppData Path",@Appdata) to your code near the beginning. As for running as the user you could run a launcher a service and use RunAs() to run your actual script if need be.

if I do a RunAs() wouldn't I then need the user's name and password? I want this to run on whatever user is logged in.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...