#1
|
|||
|
|||
Prompt Value
What's the best most sure proof way of determining what the prompt value is... also is there a way to disable the "--more--" prompt?
I need the prompt value so that I can use the readstring method without having to change things manually for the ending string... some of our devices use # or > plus the host name as the prompt and I want to make sure the prompt isn't part of the read string. I also want to get rid of the "--more--" prompt because it requires that you press spacebar or something to see subsequent pages, but this spacebar or similar press appears to be stored with the readstring, which is making parsing the output even more difficult. Any timely help is appreciated ![]() |
#2
|
|||
|
|||
Hi gunslingor,
Your question about the --more-- prompt is a Cisco configuration question. There will likely be some way to disable paging on the Cisco device. I would suggest consulting the documentation of the device to see what is possible. With regards to the prompt, there is no sure way to always get the prompt, but we do have an example that might help which is located in the following post: http://forums.vandyke.com/showthread...7294#post37294The example has a function named WaitForScreenContentsToStopChanging() that illustrates a way to capture a prompt. Does this help? |
#3
|
|||
|
|||
One way to handle multiple prompts would be to build an array with the possible prompts. Then use crt.screen.WaitForStrings and Case statements to take action based on the prompt. Here is an unrefined example:
Sub WaitFor() Dim vWaitString vWaitString = Array ("A2200> ", strNewPrompt & "> ", "Do you want to continue", "Press any key to continue", "Login:") Do Dim btnResult btnResult = crt.Screen.WaitForStrings (vWaitString) Select Case btnResult Case 1 'A2200 prompt crt.sleep 100 exit do Case 2 crt.sleep 100 exit do Case 3 crt.Screen.Send "y" & chr(13) crt.sleep 100 Case 4 'Press any key until prompt changes crt.Screen.Send "z" crt.sleep 100 Case 5 'Login crt.sleep 100 crt.Screen.Send "root" & chr(13) crt.Screen.WaitForString "Password:" crt.Screen.Send "root" & chr(13) End Select Loop End Sub |
#4
|
|||
|
|||
Thanks guys, I might try these solutions. I'm also considering the command:
"show run | include hostname" since all our prompts start with a hostname followed by ">" or "#". |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|