Reputation: 15
A very simple script to save time for something i (repeatedly) need to check @ work;
Set cloner = CreateObject("WScript.Shell")
cloner.SendKeys"telnet 0.0.0.0"
cloner.SendKeys("{Enter}")
WScript.Sleep 1000
cloner.SendKeys("whatever")
And, i'd like this to output to a .txt.
Upvotes: 1
Views: 6058
Reputation: 1
Try:
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run("telnet.exe")
WScript.Sleep 500
WshShell.SendKeys("set logfile filename.txt{Enter}")
WScript.Sleep 500
WshShell.SendKeys("open 0.0.0.0{Enter}")
WScript.Sleep 500
WshShell.SendKeys("whatever")
this will create a file named filename in the working directory, can be replaced with absolute path aswell.
Upvotes: 0
Reputation: 5823
try this one
Set cloner = CreateObject("WScript.Shell")
cloner.Run "cmd.exe"
WScript.Sleep 1000
cloner.SendKeys"telnet 0.0.0.0 -f out.txt"
cloner.SendKeys("{Enter}")
WScript.Sleep 1000
cloner.SendKeys("whatever")
Upvotes: 2