Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Run As Admin (Self execution)

$
0
0
Hi there,

I'm trying to write a script for some users in my domain.
The script needs administrator rights, but i don't want to go to every pc and type the pw in manually.

So i tried something like this:

[ autoit ]      
MsgBox(0, "Stop", "Stop?" & @LogonDomain) If IsAdmin() Then     MsgBox(0, "working", "working!") Else     RunAs("user", @LogonDomain, "PW", 2, @AutoItExe)     If @error <> 0 Then MsgBox(16, "error - empty - ", "error code = "&@error) EndIf

But the problem is, that the "IsAdmin" check is never true :/

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>