直译如下:$oShell = OBJCREATE("Wscript.Shell")
Global $ForReading = 1
$strDomainName="tjadri.com"
$objFSO = ObjCreate("Scripting.FileSystemObject")
$objTextFile = $objFSO.OpenTextFile("c:\account.txt", $ForReading)
while not $objTextFile.AtEndOfStream
$strNextLine = $objTextFile.Readline
$arrServiceList = StringSplit($strNextLine , ",")
$strCurrentUserName= $strDomainName & "" & $arrServiceList[1]
wend
msgbox(0,"",$strCurrentUserName)
$strCommand= "cmd /c net localgroup administrators " & $strCurrentUserName & " /add"
msgbox(0,"",$strCommand)
$oExec = $oShell.Exec(strCommand)
转换成au3代码猜测如下:$strDomainName="tjadri.com"
$h_File=fileopen("c:\account.txt", 0)
while 1
$strNextLine = fileReadline($h_File)
if @error then exitloop
$arrServiceList = StringSplit($strNextLine , ",")
$strCurrentUserName= $strDomainName & "" & $arrServiceList[1]
wend
fileclose($h_File)
msgbox(0,"",$strCurrentUserName)
$strCommand= @ComSpec&" /c net localgroup administrators " & $strCurrentUserName & " /add"
msgbox(0,"",$strCommand)
run(strCommand)
以上未经测试 |