Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-15-2013, 08:39 AM
gunslingor gunslingor is offline
Registered User
 
Join Date: May 2013
Posts: 27
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
The script runs well when [crt.Session.Connect "/Serial COM6 /BAUD 9600"] is commented out as shown above, and fails when its not commented out.

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?
Reply With Quote
 

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 06:32 PM.