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代码才能成功。
添加回答
举报