#1
|
|||
|
|||
how to prompt function
HI guys
Base on the example as follow,I try to modify it for my needs. But it doesn't work.Any help would be appreciated. BTW:I am a noob sfpshow 42 -f -link -force | grep -e RX -e TX I need to change 42 to variable: Port = crt.Dialog.Prompt("Enter Port:", "Port") crt.Screen.Send "sfpshow " & Port & chr(13) "| grep -e RX -e TX -e Port" VBScript Syntax crt.Dialog.Prompt(message [, title [, default [, isPassword ]]]) Example Code: Dim pass pass = crt.Dialog.Prompt("Enter your password:", "Logon Script", "", True) If pass = "" Then ' User clicked Cancel button Else ' User added data End If For your use it may look something like: Code: vlanID = crt.Dialog.Prompt("Enter VLAN ID:", "VLAN ID") crt.Screen.Send "vlan create vlan " & vlanID & chr(13) |
#2
|
|||
|
|||
Hi kingzleshe,
I believe the issue you're running into is the placement of the chr(13). chr(13) is the ascii character code for carriage return, or pressing Enter. In this case it appears that we are telling SecureCRT to "press Enter" after your variable then to send the second half of the command. If the command you need is: Code:
sfpshow 42 -f -link -force | grep -e RX -e TX Code:
crt.Screen.Send "sfpshow " & Port & " -f -link -force | grep -e RX -e TX" Code:
crt.Screen.Send "sfpshow " & Port & " -f -link -force | grep -e RX -e TX" & chr(13) Does this help get you the functionality you're looking for?
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
![]()
Thanks!
It's been very helpful. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|