编写了一个以.VBS为结尾的小程序,放在任务计划时定时运行,运行的结果有很长,如何将运行的结果自动保存
编写了一个以.VBS为结尾的小程序,放在任务计划时定时运行,运行的结果有很长,如何将运行的结果自动输出保存下来?运行该程序会弹出CMD.EXE的界面,前两行是SetWsh...
编写了一个以.VBS为结尾的小程序,放在任务计划时定时运行,运行的结果有很长,如何将运行的结果自动输出保存下来?
运行该程序会弹出CMD.EXE的界面 ,前两行是Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd" 展开
运行该程序会弹出CMD.EXE的界面 ,前两行是Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd" 展开
2个回答
2010-10-14
展开全部
运行该程序会弹出CMD.EXE的界面,实现的功能就是在一个私有系统中取出历史记录(输入结果有几千行),每天都要取出一次,想以日期为文件名每日保存下来,不知如何修改
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd"
WScript.Sleep 2000
WshShell.SendKeys"telnet 10.112.1.18"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"jilinmobile1"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"LAW266"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"xiaoht"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"775221"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"#m list measure history:;"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 9999
WshShell.SendKeys"#####;"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys"quit"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys"exit"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd"
WScript.Sleep 2000
WshShell.SendKeys"telnet 10.112.1.18"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"jilinmobile1"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"LAW266"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"xiaoht"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"775221"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys"#m list measure history:;"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 9999
WshShell.SendKeys"#####;"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys"quit"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys"exit"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2010-10-18
展开全部
哦,不好意思最近没空!
你还不如用BAT写
如果非要用VBS的话可以用重定向> 这个是覆盖 >> 这个是追加
例如:
WshShell.SendKeys"telnet 10.112.1.18 >>C:\a.txt"
你还不如用BAT写
如果非要用VBS的话可以用重定向> 这个是覆盖 >> 这个是追加
例如:
WshShell.SendKeys"telnet 10.112.1.18 >>C:\a.txt"
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询