Jump to content

RunAs


Recommended Posts

I have checked everywhere and keep falling short. I have an application that will only run correctly under an admin account, standard users are not able to run it. When I enter in the local credentials, it won't compile, keeps giving me error code 1.

RunAsWait("localadmin", "@ComputerName", "$Password", 1, "C:\Program Files(x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe" )

I have tried runas, runaswait and I am still unsuccessful. Any ideas would be greatly appreciated. 

Link to comment
Share on other sites

14 minutes ago, dmcgannon said:

RunAsWait("localadmin", "@ComputerName", "$Password", 1, "C:\Program Files(x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe" )

Do you pass the password in the variable $Password?  If so, why do you have it in quotes?  Having it in quotes says to pass the literal "$Password" not the value in the variable.  The same is true for the @ComputerName macro.  Look at the RunAsWait example in the help file.  Do you see quotes around @ComputerName or $Password in the example?

You have a local admin account named "localadmin" on the workstation?  :huh2:

Edited by TheXman
Link to comment
Share on other sites

I looked at the examples and honestly, I had a script that I used before in Windows 7 that worked correctly for a particular application. I tried to change the values for Windows 10 with different application and no success. Of course that same script hasn't wanted to work since we upgraded to 10 either....

Link to comment
Share on other sites

You seem pretty proficient with AutoIt. I've written a few scripts but am having trouble getting this one to work correctly. I haven't had issues in the past, but we've never been able to get these scripts to work on Windows 10 correctly. I have an application that only appears to run correctly is the user is an admin.

This is my code for it and the variables are defined, but when I try to compile, it gives me error code 1.

$Password= Your Local Password
$Username= localadmin
RunAsWait($Username, @ComputerName, $Password , 0, "C:\Program Files(x86)\Speco Technologies\SpecoTech Multi Client\SpecoMC.exe"

Link to comment
Share on other sites

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