Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-10-2017, 08:35 AM
tpaolillo tpaolillo is offline
Registered User
 
Join Date: Jan 2017
Posts: 10
Simple Script Example

Hi, I'm looking to do a telnet script that when runs it prompts you for a IP address then port number. Then when entered it automatically runs a telnet command and displays it on the screen.

I don't mind if the port is hardcoded into the script either.

Any help would be appreciated. Thanks
Tony
Reply With Quote
  #2  
Old 01-10-2017, 10:57 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Tony,

Do you intend to use VBScript in your scripting efforts?

If so, please review the VBScript manual on our website here.

Information on SecureCRT specific methods, properties and objects are found in the Scripting / Script Objects Reference topic in SecureCRT's Help file.

For example, you can prompt a user for input using crt.Dialog.Prompt:

Syntax
crt.Dialog.Prompt(message [, title [, default [, isPassword ]]])

strHost = crt.Dialog.Prompt("Enter IP address for connection", "Get IP")
You would then need to connect to the host, which I believe was illustrated for you in another post.

The Send() method, available to the Screen object, is how you can run a command:
crt.Screen.Send "MyCommand" & vbcr
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
ipaddress , script , telnet

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 02:09 AM.