damon Posted June 4, 2010 Share Posted June 4, 2010 I have looked for this but can not find what I am trying to do. I have a script and need it to promote its self to admin I know that runas is the way but with the script I am running it recalls the file. expandcollapse popupLocal $user = "admin" Local $pass = "password" If IsAdmin () = 0 Then If RunAs ( $user, @ComputerName, $pass, 0,@autoitexe, @scriptdir) = 0 Then MsgBox (0, "Xport Update", "Xport Update Failed. Please Contact Support Technican for Installation Update" & @CRLF & "ERROR 0001") Exit EndIf EndIf $w = 0 Do If ProcessExists ("Xport.exe") <> 0 Then If ProcessClose ("Xport.exe") = 0 Then MsgBox (0, "Xport Update", "Xport Update Failed. Please Contact Support Technican for Installation Update" & @CRLF & "ERROR 0005") Exit EndIf EndIf $w = $w + 1 Until $w = 5 If ProcessExists ("Xport.exe") <> 0 Then MsgBox (0, "Xport Update", "Xport Update Failed. Please Contact Support Technican for Installation Update" & @CRLF & "ERROR 0007") Exit EndIf If FileCopy ("xport.exe", "C:\GPS Software\Xport\xport.exe",9) = 0 Then MsgBox (0, "Xport Update", "Xport Update Failed. Please Contact Support Technican for Installation Update" & @CRLF & "ERROR 0010") Exit EndIf If FileCopy ("xport.exe.manifest", "C:\GPS Software\Xport\xport.exe.manifest",9) = 0 Then MsgBox (0, "Xport Update", "Xport Update Failed. Please Contact Support Technican for Installation Update" & @CRLF & "ERROR 0015") Exit EndIf MsgBox (0, "Xport Update", "Xport Update Completed Successfully. Please Reboot Computer") Windows XP Service pack 3 machine It always amazes me how one little thing can cause so much havoc Link to comment Share on other sites More sharing options...
JohnOne Posted June 4, 2010 Share Posted June 4, 2010 #RequireAdmin AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
damon Posted June 4, 2010 Author Share Posted June 4, 2010 (edited) I got it usinghttp://www.autoitscript.com/forum/index.php?showtopic=81741&st=0&p=586419&hl=run%20current%20script%20as%20admin&fromsearch=1&#entry586419 Edited June 4, 2010 by damon It always amazes me how one little thing can cause so much havoc 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