Hello,
I am looking for form help, This is what i am trying to do:
Create a VB script to;
open the windows telnet client, connect to a telnet server, browse to a certain directory, list the folders in that directory, copy that list from the telnet window, paste to excel for filtering.
I am new to VB and programing, the below code is getting me as far as listing the folders in the telnet window.
Option explicit
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "telnet"
WScript.Sleep 3000
oShell.Sendkeys "open serverIP~"
WScript.Sleep 2000
oShell.Sendkeys "user~"
WScript.Sleep 1000
oShell.Sendkeys "password~"
WScript.Sleep 1000
oShell.Sendkeys "cd /directory path ~"
oShell.Sendkeys "ls -1 | sort~"
'WScript.Sleep 20000
oShell.Sendkeys "% ( )" 'these lines are supposed to open the telnet menu to highlight and copy all text in the console, but the alt is not working
oShell.Sendkeys "es" 'so the menu never opens, if you try same with notepad it does work fine
if you manually press Alt+Spacebar then es you end up with all text highlighted no problem, it just wont work in the script for some reason.
this is for my work and there are lots of restrictions around what client is used so i have to stick with the windows telnet client
i can also use ftp but i am running into the same alt + spacebar problem in the cmd window also when trying to copy the text
Does anyone know why this does not work, Or is there a better but still simple way i can do the task I am trying to do?
I currently do this task manually about 15 times per day
Any help would be much appreciated.
I am looking for form help, This is what i am trying to do:
Create a VB script to;
open the windows telnet client, connect to a telnet server, browse to a certain directory, list the folders in that directory, copy that list from the telnet window, paste to excel for filtering.
I am new to VB and programing, the below code is getting me as far as listing the folders in the telnet window.
Option explicit
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "telnet"
WScript.Sleep 3000
oShell.Sendkeys "open serverIP~"
WScript.Sleep 2000
oShell.Sendkeys "user~"
WScript.Sleep 1000
oShell.Sendkeys "password~"
WScript.Sleep 1000
oShell.Sendkeys "cd /directory path ~"
oShell.Sendkeys "ls -1 | sort~"
'WScript.Sleep 20000
oShell.Sendkeys "% ( )" 'these lines are supposed to open the telnet menu to highlight and copy all text in the console, but the alt is not working
oShell.Sendkeys "es" 'so the menu never opens, if you try same with notepad it does work fine
if you manually press Alt+Spacebar then es you end up with all text highlighted no problem, it just wont work in the script for some reason.
this is for my work and there are lots of restrictions around what client is used so i have to stick with the windows telnet client
i can also use ftp but i am running into the same alt + spacebar problem in the cmd window also when trying to copy the text
Does anyone know why this does not work, Or is there a better but still simple way i can do the task I am trying to do?
I currently do this task manually about 15 times per day
Any help would be much appreciated.