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

runas win admin win7

$
0
0
is there a way to do runas and have it execute with admin privileges with having use #requireadmin in the program executed by runas..

If I run this, it returns test 0

here is simple example
test.exe:
msgbox(0,@username,isadmin())

[/size]
[size=4]#RequireAdmin
; Fill in the username and password appropriate for your system.
Local $sUserName = "test"
Local $sPassword = "test"[/size]
[size=4]Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, 'test.exe', @SystemDir)[/size]
[size=4]


So I am running, the script with admin permissions, I do run as and it shows it is not admin.
If I put #requireadmin in test.exe, it will prompt me again, but i only want the one prompt

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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