IT_9600 Posted August 24, 2015 Posted August 24, 2015 Hello,I have a little script which I want to run as a non-admin user. When the exe starts I want to wait for the window to open and make a change of a combobox and a click.I run the Program.exe inside the script as domain-admin.The problem is that the script only run when I execute the complete script as domain-admin, when I start it as a non-admin-user it opens the Program.exe and stop.What can be the problem that the WinExists-command is not working? Do I need any parameters when I use RunAs?Here's the script:RunAs("admin","domain","password",0,"c:\temp\Program.exe") While 1 If WinExists("program_name","Language") Then ControlCommand("program_name","","ComboBox1","SelectString",'Language') ControlClick("program_name", "Continue","Button14") ... Else sleep(200) EndIf WEnd
Surya Posted August 24, 2015 Posted August 24, 2015 (edited) I think you should add RunAs("admin","domain","password",0,"c:\temp\Program.exe",@SystemDir,@SW_SHOW)because in runas usually runs the program hidden you should specify that you have to show the window then i think that winexist will work check the help of winexists in help of autoit you will see that winexists wont show true on hidden windows and check runas help file then you would see that runas 7th parameter is defaultly @SW_HIDE so you have to set it to @SW_SHOW Edited August 24, 2015 by Surya No matter whatever the challenge maybe control on the outcome its on you its always have been. MY UDF: Transpond UDF (Sent vriables to Programs) , Utter UDF (Speech Recognition)
IT_9600 Posted August 24, 2015 Author Posted August 24, 2015 no, it doesn't work with the new parameters.Any other ideas?
IT_9600 Posted August 25, 2015 Author Posted August 25, 2015 (edited) I found a solution on Zero Budget IT AdminIf the script doesn't run as admin I simply restart it as admin :-)Thanks for help! Edited August 25, 2015 by IT_9600
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