#$language = "VBScript"
#$interface = "1.0"
' This automatically generated script may need to be
' edited in order to work correctly.
' https://www.runyf.cn
crt.Screen.Synchronous = True
Sub mysub()
crt.Session.LogFileName = "D:\Crtvbs\log\"&log_file&".txt"
'日志文件保存在D:\Crtvbs\log\目录
Call crt.Session.Log(True)
'开启会话日志
crt.Screen.Send "show clock" & VbCr
crt.Screen.Send command & VbCr
Do while (crt.Screen.WaitForStrings("CTRL+C break","MORE",3)<>False)
crt.Screen.Send " "
Loop
Call crt.Session.Log(False)
'关闭会话日志
End Sub
command = inputbox("请输入要执行的命令","提示信息")
log_file = inputbox("请输入会话日志文件名","提示信息")
flag = command <> "" And log_file <> ""
If flag Then
call mysub()
Else
MsgBox "输入不完整"
End If
最后修改:2023 年 05 月 02 日
© 允许规范转载