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 10-16-2020, 02:54 PM
samky2005 samky2005 is offline
Registered User
 
Join Date: Feb 2010
Posts: 12
Question enter different strings

Hello

How can I write the script to enter manually some device specific string?
The below example, abc is value.

crt.Screen.Send "hostname abc" & chr(13)

There are many devices, and everytime the script runs for the device., it sends many common commands, but some parameter should be unique like above example.

Thanks
samky2005
Reply With Quote
  #2  
Old 10-16-2020, 03:27 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,040
Quote:
Originally Posted by samky2005 View Post
How can I write the script to enter manually some device specific string?
Your question seems conflicted...
A script is used to automate data entry, but you want to use a script to manually enter data?

Quote:
Originally Posted by samky2005 View Post
The below example, abc is value.

crt.Screen.Send "hostname abc" & chr(13)

There are many devices, and everytime the script runs for the device., it sends many common commands, but some parameter should be unique like above example.
The information you've provided so far is too ambiguous to know how to help.
  • What exactly is "unique" about the 'abc' in the example you provided?
  • Where is the "unique" data currently stored?
  • How do you associate the "unique" data to any particular host?
If you can provide more details and perhaps give 2-3 additional scenarios along with those details that we can use to fill in the gaps, it may become more clear how we might be able to answer your question.

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #3  
Old 10-16-2020, 03:56 PM
samky2005 samky2005 is offline
Registered User
 
Join Date: Feb 2010
Posts: 12
Hello Jake

Thanks for your prompt reply and sorry for it wasn't clear.
  • What exactly is "unique" about the 'abc' in the example you provided?
  • Where is the "unique" data currently stored?
  • How do you associate the "unique" data to any particular host?

I meant to say every device has configure the different hostname.
The situation is I have 100 switches from 5 models. Every device will need to have different hostname. Naming doesn't really go by the model type. I'm not sure such the rule can be scripted easily to map switches properly, hence I wanted to set hostname by quick and easiest way manually while other common parameters are sent by crt.screen.send to all the devices.

Such the name is stored in the excel file or can be in txt file.

Is there way to read the hostname from the file and use it as the variable for "hostname <value>" without any duplication?


I just could see that the following has met my expectation.

strAnswer = InputBox("Please enter the hostname command: ")
crt.Screen.Send strAnswer & vbcr

I need to figure out how to expect only certain words in crt.Screen.WaitForString. The return prompt from devices will have the same string "abc" in it i.e. "[abc123]" "<abc_234>" "[abc_234]" "<abcdefe>" "abc88sdfd"
Any advice would be appreciated.

Thanks
samky2005
Reply With Quote
  #4  
Old 10-16-2020, 04:27 PM
samky2005 samky2005 is offline
Registered User
 
Join Date: Feb 2010
Posts: 12
Smile

>I need to figure out how to expect only certain words in crt.Screen.WaitForString. The return prompt from devices will have the same string "abc" in it i.e. "[abc123]" "<abc_234>" "[abc_234]" "<abcdefe>" "abc88sdfd"

I figured it out.
Reply With Quote
  #5  
Old 10-16-2020, 04:55 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,040
Quote:
Originally Posted by samky2005 View Post
>I figured it out.
Glad you're all set.

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
Reply

Tags
crt.screen.send , input


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 05:37 AM.