Using SecureCRT terminal with these commands. When the script executes the SendXmodem to push the file it always defaults to the smallest 128k block size. SecureCRT is able to push files with 1024 block sizes (Xmodem-1K) from the GUI interface commands but I want to automate it in the vbs script. Any way in the vbs script to tell xmodem to switch to 1024k? All sessions in SecureCRT are set to 1024k.
This command runs on the Cisco switch and readies the Cisco switch to receive the file.
crt.Screen.Send "copy xmodem: flash:c3750-advipservicesk9-mz.122-25.fz.bin" & chr(13)
This command runs on the windows PC serving the file pushed to the Cisco switch.
crt.FileTransfer.SendXmodem("C:\Users\NEW USER\Desktop\IOS\c3750-advipservicesk9-mz.122-25.fz.bin")
Copy time at 128k is about 2 hours and 1024k is 25 minutes. This is to recover a switch which has a lost or corrupted software. Older Cisco switches are only layer 2 so no layer 3 TCPIP available for newer/faster protocols.
Tried to modify the command SendXmodem with flags like /B 1024 or /Blocksize 1024
crt.FileTransfer.SendXmodem
Options for a SecureCRT session are stored in
.inifiles found within the "Sessions" subfolder of SecureCRT's configuration folder (Options / Global Options, Configuration Paths category).Searching through a SecureCRT session configuration
.inifile for the term "XModem", you'll find an option named "XModem Send Packet Size" on a line that looks like this, by default:If you edit your session options and enable the 1024 bytes (Xmodem-1k/Ymodem-1k) option in the Terminal / X/Y/Zmodem category, apply that change, and then refer to the refreshed contents of the corresponding .ini file you should see that the same line ends in a
1.SecureCRT's scripting API is documented within SecureCRT's built-in help. Take a look at the Scripting / Script Objects Reference chapter, specifically the SessionConfiguration Object topic. There are a few examples of both VBScript and Python code showing how to use both
GetOptionandSetOption.Specific to the objective you're trying to accomplish, the code would look like this...
Python:
VBScript:
To disable the option, the code would look like this:
Python:
VBScript:
Please note that
crt.Session.Configalways refers to the configuration associated with the session related to the tab/tile in which the script is running. This means that if you established your connection using something like this (Python)...objTab = crt.Session.ConnectInTab(strMyConnInfo), then you would need to use theobjTabreference instead ofcrt.For example:
objTab.Session.Config.SetOption("XModem Send Packet Size", true)