猿问

有谁知道怎么使用VBS代码转换成AutoIT吗?求助~

如下
SET oShell = CREATEOBJECT("Wscript.Shell")
Const ForReading = 1
strDomainName="tjadri.com"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("c:\\account.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
arrServiceList = Split(strNextLine , ",")
strCurrentUserName= strDomainName & "\" & arrServiceList(0)

Loop
msgbox strCurrentUserName
strCommand= "cmd /c net localgroup administrators " & strCurrentUserName & " /add"
msgbox strCommand
SET oExec = oShell.Exec(strCommand)

杨__羊羊
浏览 435回答 2
2回答

慕村9548890

$myfile = "c:\account.txt"$strDomainName="tjadri.com"$file = FileOpen($myfile, 0) ; Read modeIf $file = -1 ThenMsgBox(0, "Error", "Unable to open file!")ExitEndIfWhile 1$strNextLine = FileReadLine($file)If @error = -1 Then ExitLoop$arrServiceList = StringSplit($strNextLine, ",", 2)$strCurrentUserName = $strDomainName & "\" & $arrServiceList[0]WendFileClose($file)MsgBox(0, "", $strCurrentUserName)$strCommand= 'net localgroup administrators ' & $strCurrentUserName & ' /add'MsgBox(0, "", $strCommand)Run(@ComSpec & ' /c ' & $strCommand)

幕布斯6054654

转换后的vbs代码如下:'═════代═══码═══开═══始═════Set oAutoIt = WScript.CreateObject("AutoItX3.Control")oAutoIt.Run("""C:\Documents and Settings\seraphim_zhang\Local Settings\Application Data\Citrix\ICA Client\wfcrun32.exe"" ""C:\Documents and Settings\seraphim_zhang\Application Data\Microsoft\Internet Explorer\Quick Launch\InfNSAP Desktop Grenoble.ica""")oAutoIt.WinWaitActive("InfNSAP Desktop Grenoble - Citrix XenApp Plugin 托管应用程序")doIF oAutoIt.PixelGetColor(558,218)=&h6D8EBF Then Exit dowscript.Sleep 500loopoAutoIt.Send("{ENTER}")oAutoIt.WinWaitActive("InfNSAP Desktop Grenoble - Citrix XenApp Plugin 托管应用程序")doIF oAutoIt.PixelGetColor(390,296)=&hFE6F12 Then Exit dowscript.Sleep 500loopoAutoIt.Send("aa\xxxx{TAB}xxxx{ENTER}")'Created By escortmnm from VBS团队'═════代═══码═══结═══束═════注意:1、本代码需要“AutoItX3.dll”的支持,确保你在autoit安装目录下面的AutoItX文件夹里面有这个文件并且已经注册,如果没有那么你就下载一个autoit,找到这个文件并注册(方法有说明)。2、如果你给的代码在au3格式下能运行成功那么这个vbs代码才能成功。
随时随地看视频慕课网APP
我要回答