srokar Posted November 10, 2015 Posted November 10, 2015 Hi thereI am new on this forum. I used AutoIt couple of times earlier but in this case i have to ask about help.So, I have one program, which have to be run under Win7 with admin privileges. I have two options. 1 run script as admin, 2 run program as admin.Everything could be OK, but computer is in internal domain. To run program as admin I have to give administrator user name and password.Computer is used by primitive workers and the coulnd't know those passwords. AutoIT will be great, bec. later if i put in script login and password, and compile it, workers couldnt see those informations.I have tried with RunAs, but all the time it pop ups an window to get admin pass and login. In this moment, send() function doesn't work too.I would be very grateful of every helpBest regards
ViciousXUSMC Posted November 10, 2015 Posted November 10, 2015 There are many ways to do this, it depends on your environment and script purpose as to what would work best.You can do a simple 2 script approach like this. Its what I have done on occasion.Script#1 Your Working Script compiled to an .exe MsgBox(0, "", "Run As " & @UserName)Script #2 Your Call script compiled to an .exe RunAs("DomainAdmin", "DomainName", "Password", 2, "Script1.exe")The call script will run your work script as the defined user, play around with the logon flag to find the value that works best for what you need.The bad thing here is embedding admin credentials into a script, so I generally would not do this without some kind of encryption or a temporary admin account.
pcjunki Posted November 10, 2015 Posted November 10, 2015 if your in a domain, call the exe in a login script in active directory.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now