VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   enter different strings (https://forums.vandyke.com/showthread.php?t=14314)

samky2005 10-16-2020 02:54 PM

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

jdev 10-16-2020 03:27 PM

Quote:

Originally Posted by samky2005 (Post 54181)
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 (Post 54181)
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

samky2005 10-16-2020 03:56 PM

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

samky2005 10-16-2020 04:27 PM

>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. :)

jdev 10-16-2020 04:55 PM

Quote:

Originally Posted by samky2005 (Post 54186)
>I figured it out. :)

Glad you're all set.

--Jake


All times are GMT -6. The time now is 01:40 PM.