Jump to content

Using RunAs to install software

Recommended Posts

Hi everyone,

I'm brand new to using AutoIT and am currently stuck at trying to install software using the RunAs function.

I'm trying to run a bat file as an admin and the end result should be a desktop icon, however, this is only happening if I use the credentials of the user that is currently logged in. This is what I'm doing so far:

; Script Start - Add your code below here

#include <AutoItConstants.au3>

$program = "\\share\softwaredeployment\software\program.bat"

RunAs("admin", "acme.com", "Forum123", $RUN_LOGON_PROFILE, $program)

When I run that script, nothing happens, when I change the credentials to the currently logged on user, it will create the icon.

I have tried replacing the logon flag, $RUN_LOGON_PROFILE with the other three variations, (NOPROFILE, NETWORK & INHERIT) but no luck.

What am I doing incorrectly?

Thank you in advance for your suggestions and help.




Share this post

Link to post
Share on other sites

The RunAs function does not run a process with the Admin Token.  It only runs it as the requested user.  Have a look at this thread for a similar situation to what you are trying to do.  




Share this post

Link to post
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

  • Create New...