|
#1
|
|||
|
|||
VBscript SecureCRT Run Outside
Here's my first simple script I have a questions about:
Code:
Language="VBScript" Interface="1.0" call Main Sub Main() Run "C:\Program Files\VanDyke Software\SecureCRT\SecureCRT.exe" 'crt.Session.Connect "/Serial COM6 /BAUD 9600" End sub Sub Run(ByVal sFile) Dim shell Set shell = CreateObject("WScript.Shell") shell.Run Chr(34) & sFile & Chr(34), 1, false Set shell = Nothing End Sub I suspect because crt.whatever is only interpretable when you actually "Run" the script from within secureCRT, is that right? Ideally, I'd like to be able to just double click on the script (as I'm doing now) and have it open CRT and then be able to do what I want. Is this possible, or do you have to run it from within CRT? |
#2
|
||||
|
||||
Quote:
I have added your forum post to our request database and if we expose the API in a future release we'll post a follow up message to this thread. If you'd like to receive email notification please let us know and refer to forum thread 11022. Would it be helpful if SecureCRT automatically ran the script when you start it, so that instead of double clicking the script you just double click a particular SecureCRT icon?
__________________
Mike VanDyke Software Technical Support [http://www.vandyke.com/support] |
#3
|
|||
|
|||
Code:
Would it be helpful if SecureCRT automatically ran the script when you start it, so that instead of double clicking the script you just double click a particular SecureCRT icon? What I'd "like" to do is to be able to write an application, say in MS Access or perhaps many other platforms, that can interface easily with secureCRT. I mean, currently I'm working on this script to grab some basic configuration data from cisco devices, then I need to import this into an Access DB so we can filter and sort on the data, track changes, etc. Right now its looking like I'm going to need to write a script for secureCRT (perhaps multiple for each model we have because the commands can be different-later). This script will do a lot of show commands, parsing of the output (like pulling version 12.2(SE1)55) out of the output, and sending it to a text file. Then in my access DB, I'll need some kind of importing, and maybe more parsing, code that will pull the text file data into my DB... Ideally, their should be a way to do this such that my users will only need to press one button to run all this from within my access DB (one of the goals of my job function is tool integration). So, in effect, they'd press the button in access and it'll run the VB code. The first item in the code would probably be 'open CRT'.... if there was a way to pass arguments on this open command, like the location of the script file, then the script could run when its open... so rather than running a script on open like you suggest, make CRT accept a script location argument when its opened using code. How to then pass control back to Access, or similar, after the script runs, I'm not sure that'll be easy to accomplish... so perhaps there's just a way to turn secureCRT into an axtiveX control or to expose the API to the OS... in all honestly, and ideally, I would love to have all the functionally of secureCRT without having to actually use the front end...or perhaps a way to integrate the frontend and API with other applications. Make sense? I'm a computer engineer, but I do currently feel like a noob as this is my first adventure with secureCRT and networking. Last edited by gunslingor; 05-15-2013 at 12:44 PM. |
#4
|
||||
|
||||
One of the command-line options that SecureCRT supports is /SCRIPT.
SecureCRT.exe /SCRIPT "C:\Some Path\Your Script.vbs"You might also consider using SecureCRT's Logon script option (Session Options / Connection / Logon Actions).
__________________
Mike VanDyke Software Technical Support [http://www.vandyke.com/support] |
#5
|
|||
|
|||
Cool, I'll give that a try once I get the code further along.
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|