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

Adding local admins using @ComSpec and net localgroup

$
0
0
I'm trying to run the following to add local admins on a freshly imaged machine...

[ autoit ]      
$test = "username" RunWait(@ComSpec & " /c " & "net localgroup administrators domain\" & $test & " /add", @SW_HIDE) ConsoleWrite(@ComSpec & " /c " & "net localgroup administrators domain\" & $test & " /add")

When I take the console output and copy paste that into the Run box in windows, it runs fine. When I run the script, the local admin doesn't get added in. Any ideas what I'm doing wrong here?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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