Tum Posted June 26, 2012 Share Posted June 26, 2012 Hi, Thanks for a great program, Seems fairly easy to get to grips with. Problem am having at the minute is executing a program that requires admin rights. Ive search google and found the command "#RequireAdmin" which obviously executes the program, but am still required to click Yes on the "User Account Control" Which for some reason AutoIT cannot click. Also i have tried using the "RunAs" command but still doesnt work. Also in properties on the actually program ive ticked the box for "Run this program as an admistrator" Could someone please help me sort this out ? Thanks Link to comment Share on other sites More sharing options...
water Posted June 26, 2012 Share Posted June 26, 2012 Welcome to Autoit and the forum!What do you mean by "Also i have tried using the "RunAs" command but still doesnt work.We need more information so we can help you. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
jdelaney Posted June 26, 2012 Share Posted June 26, 2012 (edited) What I've done over here, is setup a task that runs at highest permissions. That task can run a exe, or au3 file, which will not require you to click the allow rights, and can be started with a simple batch file. You can also start your script from an admin cmd prompt to get arround the same issue. Edited June 26, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Tum Posted June 26, 2012 Author Share Posted June 26, 2012 Welcome to Autoit and the forum!What do you mean by We need more information so we can help you.Hi,When i say i have tried using the command i have used it like this :RunAs("USERNAME", "SYSTEM", "PASSWORD", 0, "C:UsersDave-2DownloadsD3-IMneytiri.exe")the program am trying to load is called neytiri.exeI have set the program in its preferences to run as an admistrator, but i still get the "User Account Control" box popping up, and have to press "Y"es to run the program. I cant get AutoIT to click this Y as well.Is there a way to stop the "User Account Control" popping up, and automatically run the program. Link to comment Share on other sites More sharing options...
Tum Posted June 26, 2012 Author Share Posted June 26, 2012 Actually, i just tried it using this command line. Run("C:UsersDave-2DownloadsD3-IMneytiri.exe") But the program just doesnt seem to run at all. Even though if i click the program link for the desktop it runs fine. But when it runs (after i click it from the desktop) it brings up the command box "User Account Control" which autoit still doesnt seem to be able to click Yes to anyway. So my problem are these. 1) The program itself doesnt even execute. 2) and if it did execute, how can i get autoit to click the "Y"es in the "User Account Control". Thanks for any help Link to comment Share on other sites More sharing options...
Venix Posted June 26, 2012 Share Posted June 26, 2012 (edited) The program itself doesnt even execute.Have you tried ShellExecute, not sure about running it in admin however.Edit: You could try using controlclick to click the yes button however I have never really played around with this function and couldn't give you any advice on it. However it may be what your looking for.Edit 2: After further research on the forums I don't beleive its possible to automate the UAC window for security reasons but good luck if you manage to find a fix . Edited June 26, 2012 by Venix Link to comment Share on other sites More sharing options...
Tum Posted June 27, 2012 Author Share Posted June 27, 2012 Thanks for your reply. ShellExecute runs the program, thanks a lot. But ye now am struggling with the UAC popup that i cannot access Anyone got any other method that might allow me to click the yes button in UAC popup please ? Link to comment Share on other sites More sharing options...
Tum Posted June 27, 2012 Author Share Posted June 27, 2012 Ah, i found that now the #RequireAdmin command does the trick PUtting this makes the script require admin, but then doesnt ask for it when the script tries to run the program that required it Link to comment Share on other sites More sharing options...
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