kasarah Posted May 20, 2008 Share Posted May 20, 2008 I'm testing something and I'm forced to run with UAC on (lucky me, eh?). I'm attempting to do something simple, a dos command ipconfig /release. Well, /release requires admin priviledges and I'm getting some we I've tried a couple iterations of the following code. Some notes.. If I just double-click (ie don't manually run in "Admin" mode), then it appears like the script flashes up in the process explorer and doesn't really run. No file is created. If I run it in Admin mode, I get the following error pop-up: "<Program Name> A referral was returned from the server." A google search says something about creating a certificate for this program. This seems like a bit of over-kill for something so simple. Has anyone got something like this to work? I'm running all these as compiled. I've tried to manually set Admin priviledge in properties box with same error. I've tried _RunDos and RunWait both with elevate and no elevate. Any thoughts would be greatly appreciated. Thanks, B ===== #RequireAdmin #include-once #include <file.au3> #include <Process.au3> #include <IE.au3> Opt("WinTitleMatchMode",2) ; $file=FileOpen("c:\rats\atest.txt",1) ; FileWriteLine($file,"Starting Test.\n") _RunDos('elevate ipconfig /release') ;RunWait(@ComSpec & " /c " & 'elevate ipconfig /release', "", @SW_HIDE) ; FileWriteLine($file,"Starting Loop\n") $count=0 While ($count<10) ; FileWriteLine($file,"Checking for Windows exist:" & $count) ; WindowsCaptureList("UAC Check") If WinExists ("User ", "") Then WinActivate("User ","") Send("{Tab 2}") Send("{Enter}") Endif Sleep (5000) $count=$count+1 WEnd Run(@ComSpec & " /c " & 'ipconfig /renew', "", @SW_HIDE) ; FileClose($file) 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