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.

 

 

 

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...