如何将 VB 脚本的输出写入文件? [英] How to write an output of a VB script to a file?

查看:40
本文介绍了如何将 VB 脚本的输出写入文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本可以将某些命令的值输出到终端?谁能帮我修改脚本以将输出写入文件?

I have a script which will output the values of certain commands to the terminal?Can anyone help me to modify the script to write the output to a file?

:: Open a Telnet window

start telnet.exe 192.168.1.1

:: Run the scrip

cscript SendKeys.vbs



set OBJECT=WScript.CreateObject("WScript.Shell")
WScript.sleep 50 
OBJECT.SendKeys "Administrator{ENTER}" 
WScript.sleep 50 
OBJECT.SendKeys "admin{ENTER}"
WScript.sleep 50 
OBJECT.SendKeys "{ENTER}"

For i = 1 to 10
 i = i - 1
 OBJECT.SendKeys "voice profile list{ENTER}"
 WScript.sleep 5000
 OBJECT.SendKeys "system debug cpu{ENTER}"
  WScript.sleep 2000
 OBJECT.SendKeys "memm stats{ENTER}"
 WScript.sleep 5000
Next

推荐答案

Telnet 脚本工具"正是您所需要的.我过去用过它,效果很好.http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php

The "Telnet Scripting Tool" is what you need. I have used it in the past, and it works great. http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php

如果我没记错的话,它还可以消除窗口失去焦点时脚本挂起的问题.

And if I recall correctly, it also negates the issue of the script hanging if the window loses focus.

tst10.exe /r:script.txt /o:output.txt

这篇关于如何将 VB 脚本的输出写入文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆