2 回答
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)
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代碼才能成功。
添加回答
舉報
