Jump to content

Recommended Posts

Posted

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. 

Posted (edited)
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
Posted

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

Posted

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"

Posted

Yes, we actually have disabled the administrator account due to security concerns and have another admin account defined as localadmin. If I put quotes around the strings, I still can't get it to compile.

Posted

; Set the RunAs parameters to use local adminstrator account
RunAsWait("admin", @ComputerName, "EnterPassword", 0, "%windir%\system32\notepad.exe"

Sorry... obviously admin is whatever admin user is and then put in the password.

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