为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

杨__羊羊 2021-12-02 11:07:18
如下SET oShell = CREATEOBJECT("Wscript.Shell")Const ForReading = 1strDomainName="tjadri.com"Set objFSO = CreateObject("Scripting.FileSystemObject")Set objTextFile = objFSO.OpenTextFile _("c:\\account.txt", ForReading)Do Until objTextFile.AtEndOfStreamstrNextLine = objTextFile.ReadlinearrServiceList = Split(strNextLine , ",")strCurrentUserName= strDomainName & "\" & arrServiceList(0)Loopmsgbox strCurrentUserNamestrCommand= "cmd /c net localgroup administrators " & strCurrentUserName & " /add"msgbox strCommandSET oExec = oShell.Exec(strCommand)
查看完整描述

2 回答

?
慕村9548890

TA贡献1884条经验 获得超4个赞

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



查看完整回答
反对 回复 2021-12-06
?
幕布斯6054654

TA贡献1876条经验 获得超7个赞

转换后的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 托管应用程序")
do
IF oAutoIt.PixelGetColor(558,218)=&h6D8EBF Then Exit do
wscript.Sleep 500
loop
oAutoIt.Send("{ENTER}")
oAutoIt.WinWaitActive("InfNSAP Desktop Grenoble - Citrix XenApp Plugin 托管应用程序")
do
IF oAutoIt.PixelGetColor(390,296)=&hFE6F12 Then Exit do
wscript.Sleep 500
loop
oAutoIt.Send("aa\xxxx{TAB}xxxx{ENTER}")
'Created By escortmnm from VBS团队
'═════代═══码═══结═══束═════

注意:
1、本代码需要“AutoItX3.dll”的支持,确保你在autoit安装目录下面的AutoItX文件夹里面有这个文件并且已经注册,如果没有那么你就下载一个autoit,找到这个文件并注册(方法有说明)。
2、如果你给的代码在au3格式下能运行成功那么这个vbs代码才能成功。



查看完整回答
反对 回复 2021-12-06
  • 2 回答
  • 0 关注
  • 434 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信