Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get telnet output taking input from an excel sheet using macro

1,701 views
Skip to first unread message

Smruti

unread,
Jan 29, 2011, 10:11:38 AM1/29/11
to
HI All,

I am writing a Macro where I want to take input(IP Address) from a
specified excel sheet,then through some command I will get some output
in Telnet session then I Need to store it as a LOG.

Please suggest me...............

Thanks,
Smruti

Al Dunbar

unread,
Jan 29, 2011, 7:09:50 PM1/29/11
to

"Smruti" <smruti...@gmail.com> wrote in message
news:86df7e3d-72d9-4298...@l22g2000pre.googlegroups.com...

Are you writing this as an excel macro? If so, the language is VBA, whereas
this newsgroup is for VBScript.

If not VBA, but VBScript, then I would suggest that you write a script that
opens a spreadsheet, extracts an IP address from whichever cell it might be
located in. Once your script has the IP address, it would then either create
a telnet session or connect to an existing one, issue some unspecified
command to the telnet host (or so I would assume), capturing the output to
store in either a log file or the event log, whichever you need.

Which parts of the above are you having difficulty with?

/Al

Smruti

unread,
Jan 30, 2011, 2:22:42 AM1/30/11
to
On Jan 30, 5:09 am, "Al Dunbar" <aland...@hotmail.com> wrote:
> "Smruti" <smruti.ite...@gmail.com> wrote in message

I am writing Excel macro...........Please suggest if you have any
ideas in VBA...........

Al Dunbar

unread,
Jan 30, 2011, 12:01:56 PM1/30/11
to

"Smruti" <smruti...@gmail.com> wrote in message

news:ca469377-8fdb-4cc5...@k18g2000vbq.googlegroups.com...

Sorry, no. As I have said this group is for vbscript, not vba. There are
similarities, for sure, and perhaps some of the others that frequent this
group may have suggestions for you. Have you looked for an excel-specific or
vbs-specific newsgroup? For example alt.comp.lang.vba or
microsoft.public.office.developer.vba?

/Al

lax

unread,
Aug 30, 2011, 3:17:34 AM8/30/11
to
Al Dunbar wrote on 01/30/2011 12:01 ET :
> "Smruti" wrote in message
> news:
>> On Jan 30, 5:09 am, "Al Dunbar" wrote:
>>> "Smruti" wrote in message
>>>
>>> news:

>>>
>>> > HI All,
>>>
>>> > I am writing a Macro where I want to take input(IP Address) from a
>>> > specified excel sheet,then through some command I will get some output
>>> > in Telnet session then I Need to store it as a LOG.
>>>
>>> > Please suggest me...
>>>
>>> Are you writing this as an excel macro? If so, the language is VBA,
>>> whereas
>>> this newsgroup is for VBScript.
>>>
>>> If not VBA, but VBScript, then I would suggest that you write a script
>>> that
>>> opens a spreadsheet, extracts an IP address from whichever cell it might
>>> be
>>> located in. Once your script has the IP address, it would then either
>>> create
>>> a telnet session or connect to an existing one, issue some unspecified
>>> command to the telnet host (or so I would assume), capturing the output
>>> to
>>> store in either a log file or the event log, whichever you need.
>>>
>>> Which parts of the above are you having difficulty with?
>>>
>>> /Al
>>>
>>>
>>
>> I am writing Excel macro...Please suggest if you have any
>> ideas in VBA...
>>
>>
>>
> Sorry, no. As I have said this group is for vbscript, not vba. There are
> similarities, for sure, and perhaps some of the others that frequent this
> group may have suggestions for you. Have you looked for an excel-specific or
> vbs-specific newsgroup? For example alt.comp.lang.vba or
> microsoft.public.office.developer.vba?
>
> /Al
>
Hi,
I need vbscript for doing the same like connect to telnet passing an IP and
provide login username and password and the commands. And I need to get the
command output to a variable/a file.
All needs to be done in vbscript.
Please help me in doing this.

Tom Lavedas

unread,
Aug 30, 2011, 8:44:40 AM8/30/11
to
>  Hi,
>  I need vbscript for doing the same like connect to telnet passing an IP and
>  provide login username and password and the commands. And I need to get the
>  command output to a variable/a file.
>  All needs to be done in vbscript.
>  Please help me in doing this.

The important part of this is the Telnet client. The one that comes
with Windows does not support scripting. Therefore, the starting
point of your quest is to locate a third party Telnet client that does
support scripting. Then you can either use VBAs Shell() method or the
Wscript.Shell object's Run method to launch the telnet client with its
script.

I just did a quick groups.google search an it seems that one utility
you could consider is called NetCat (nc.exe) found at www.securityfocus.com/tools.
It is not actually a telnet client, but rather it can be used to open
the telnet port 23 from the command line. As a command line utility
it accepts redirected input and allows its responses to be redirected
to an output file. Some examples are found in these threads:
http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_frm/thread/d08eabc0e5c1785c/7a3ce3607e6f99ba

http://groups.google.com/group/microsoft.public.scripting.wsh/browse_frm/thread/e806d398305796b4/ddca5b10527d058

Others can be searched with this query: "script telnet
group:microsoft.public.scripting.*" sorted by date to keep from
finding out of date information.
______________________________
Tom Lavedas

0 new messages