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 06-12-2014, 02:18 PM
acampo acampo is offline
Registered User
 
Join Date: Jun 2014
Posts: 1
Question Scripts for Cisco IAD 243x

Howdy,

Got from a peer few scripts samplers to use with SecureCRT.
So far I'd been unable to make them work in my console(Win7).

Any suggestions as to how I can install them and make them work?

Here is one sample:

name: fdn.txt

&&&&&&&&&&&&&&&&&&&&&&&(separator)

# $language = "JScript"
# $interface = "1.0"

function main() {
str="fdn";
str +="\015";
crt.Screen.Send( str );
for (x=0 ; x<500000 ; ){x++};
str="zone";
str +="\015";
crt.Screen.Send( str );
}

&&&&&&&&&&&&&&&&&&&&&&&&&&&

BTW, got few more from same source, but these have a file extension (.key); as far as win7 these are viewed as registry keys.

I can't use them also.

Example:

show_run.key

On Notepad++, this file looks like this:

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

N VK_BACK "\010"
N VK_PRIOR SB_PAGE_UP
N VK_NEXT SB_PAGE_DOWN
N VK_END SB_END
N VK_LEFT VT_CURSOR_LEFT
N VK_UP VT_CURSOR_UP
N VK_RIGHT VT_CURSOR_RIGHT
N VK_DOWN VT_CURSOR_DOWN
N VK_DELETE "\177"
N VK_F1 RUN("C:\Documents and Settings\n9944364\Desktop\scripts\cisco.txt")("")
N VK_F2 RUN("C:\Documents and Settings\n9944364\Desktop\scripts\nvxcpe.txt")("")
N VK_F3 VT_PF3
N VK_F4 VT_PF4
N VK_F9 "show run"
N VK_F10 "show sip reg stat"
N VK_F12 "term len 0! show controller t1 ! Show isdn stat ! Show Memory ! Show proc cpu hist ! Show memory stat ! Show version ! Show run !"
E VK_PRIOR SB_PAGE_UP
E VK_NEXT SB_PAGE_DOWN
E VK_END SB_END
E VK_LEFT VT_CURSOR_LEFT
E VK_UP VT_CURSOR_UP
E VK_RIGHT VT_CURSOR_RIGHT
E VK_DOWN VT_CURSOR_DOWN
E VK_DELETE "\177"
C VK_BACK "\177"
C VK_TAB MENU_TAB_NEXT
C VK_PAUSE TN_BREAK
C VK_SPACE "\000"
C VK_PRIOR SB_LINE_UP
C VK_NEXT SB_LINE_DOWN
C VK_2 "\000"
C VK_6 "\036"
C VK_F4 MENU_TAB_CLOSE
C 0xBF "\037"
C 0xDC "\034"
C VK_SLASH "\037"
C VK_BACKSLASH "\034"
CE VK_PRIOR SB_LINE_UP
CE VK_NEXT SB_LINE_DOWN
S VK_BACK "\010"
S VK_DELETE "\177"
SE VK_DELETE "\177"
CS VK_TAB MENU_TAB_PREV
CS VK_2 "\000"
CS VK_6 "\036"
CS 0xBD "\037"
CS 0xBF "\037"
CS VK_QUESTION "\037"
CS VK_AT "\000"
CS VK_ASCIICIRCUM "\036"
CS VK_UNDERSCORE "\037"
A VK_RETURN MENU_TOGGLE_FULL_SCREEN
A VK_0 MENU_TAB_10
A VK_1 MENU_TAB_1
A VK_2 MENU_TAB_2
A VK_3 MENU_TAB_3
A VK_4 MENU_TAB_4
A VK_5 MENU_TAB_5
A VK_6 MENU_TAB_6
A VK_7 MENU_TAB_7
A VK_8 MENU_TAB_8
A VK_9 MENU_TAB_9

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


Any guide/help will be appreciated.

Thanks!

Webmaster@NetTrendSolutions.com
Reply With Quote
  #2  
Old 06-12-2014, 03:47 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,997
Hello acampo,

What version of SecureCRT are you using?

You don't need to install your scripts, just put them somewhere on your computer that is accessible to SecureCRT.

If the other scripts do not include header lines, once the files are copied to your Windows 7 machine, you may need to replace the .txt extension with .js (the extension for Jscript) since .txt is usually associated with a file editor (ie: Notepad).

Then choose Run from the Script menu and point to the script you wish to run.

You can also map a button on the Button Bar (or a configure a keymap) to run scripts.

Here are some useful resources regarding button bar:

http://www.vandyke.com/support/tips/button_bar.html
http://www.vandyke.com/support/tips/buttonbar.html
http://www.youtube.com/watch?v=olyCcUWRimI


The .key files are not scripts, they are keymap files. You can map SecureCRT to use a keymap file in the Terminal / Emulation category of SecureCRT's Session Options (Select an alternate keyboard emulation).

From that keymap file, it looks like your peer already had the F1 and F2 keys configured to run scripts, but it is unlikely you can place your scripts in the same location, as they seem to be Windows XP default locations:

N VK_F1 RUN("C:\Documents and Settings\n9944364\Desktop\scripts\cisco.txt")("")
N VK_F2 RUN("C:\Documents and Settings\n9944364\Desktop\scripts\nvxcpe.txt")("")


Therefore, you will need to edit the keymap file or *remap* those particular keys.

I, personally, prefer configuring keymaps in the Terminal / Emulation / Mapped Keys category of Session Options instead of having another file to keep track of, but it is all a matter of personal preference. :-)
__________________
Thanks,
--Brenda

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

Tags
cisco , cisco iad , cisco router


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 01:36 PM.