Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-15-2006, 09:50 AM
tatster tatster is offline
Registered User
 
Join Date: Aug 2006
Posts: 10
Send a message via MSN to tatster
Script to telnet to one device and then on another device

Hi,

I'm trying to setup a script to do some capture some router configs and stats.

I have got most of it done, but I'm having difficulty at the moment.
I need the script to 1)telnet to a management station, 2)login as a user, and then 3)telnet to each device and get the config.

Now I can get step 2 working on it's own. And I can get step 3 on it's own.


I have tried
Code:
objSc.WaitForString "$"
objS.Send "TELNET" ""&IP&"" & vbCr
and
Code:
objSc.WaitForString "$"
objSe.SendSpecial "TELNET" ""&IP&"" & vbCr
For both I get an error for this line that says:
Error: expected end of statement.

Any ideas? Sorry if this is a newbie mistake, I'm learning VBscript to make this SecureCRT script work.

Thanks,

Anthony Warren
Reply With Quote
  #2  
Old 08-15-2006, 10:04 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Anthony,

It looks like there is a missing set of "()" in the WaitForString and Send lines.

For example:

Code:
objSc.WaitForString ("$")
objS.Send ("TELNET" ""&IP&"" & vbCr)
Does adding these remove the end of statement message?
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
  #3  
Old 08-16-2006, 06:32 AM
tatster tatster is offline
Registered User
 
Join Date: Aug 2006
Posts: 10
Send a message via MSN to tatster
Hi Teresa,

I've tried adding those braces.

I now get and error that says:
Error: Expected ')'

For the line that says:
Code:
objSc.Send ("TELNET" ""&IP&"" & vbCr)
Reply With Quote
  #4  
Old 08-16-2006, 07:37 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Tatster,

There is another way to perform this command.

If the following line is used instead, does it run successfully?
Code:
objSe.Send "Telnet " & IP & vbcr
Note: there is a space directly after the word Telnet.
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:37 AM.