亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

有誰知道怎么使用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 關注
  • 569 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號