Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-18-2013, 08:21 AM
gunslingor gunslingor is offline
Registered User
 
Join Date: May 2013
Posts: 27
Automatically Opening SecureCRT and Connecting

So, I have a database full of IP addresses and a form that shows the IP addresses. What I'd like to do is to be able to double click on an IP address on the form, and have it automatically open SecureCRT and attempt to connect to the IP address using, at first, SSH.... later I'll add more fields to the DB to specify the connection type (e.g. telnet, ssh, etc.)

So my question is this, what the command to open SecureCRT (probably from the command prompt will suffice) and what are all the arguments I can give to the command? Any and all comments appreciated.
Reply With Quote
  #2  
Old 06-18-2013, 08:33 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi gunslingor,

All SecureCRT command-line options are documented in the help file. The path to the chapter that has the information you are seeking is Using the Software / Command-Line Options.

Are you able to accomplish your goal using this information?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 06-18-2013, 01:46 PM
gunslingor gunslingor is offline
Registered User
 
Join Date: May 2013
Posts: 27
Quote:
Originally Posted by rtb View Post
Hi gunslingor,

All SecureCRT command-line options are documented in the help file. The path to the chapter that has the information you are seeking is Using the Software / Command-Line Options.

Are you able to accomplish your goal using this information?
Likely Yes, thanks, I'll let you know the final outcome.
Reply With Quote
  #4  
Old 07-02-2013, 10:09 AM
gunslingor gunslingor is offline
Registered User
 
Join Date: May 2013
Posts: 27
Cool Results, semi-working

Alright, so I have the initial code setup. My Access form looks like this:


The code behind each button looks like this (only one button shown in full for conciseness):






So basically what happens is the user selects an IP address in the list box, then presses one of the three buttons which runs the code. Most of the code just determines what item is selected in the listbox, the last main line is where secureCRT is opened via the cmd.

Everything works as expected. The sessions don't always connect successfully, but likely this is because I don't know exactly how each IP is configured on the network (e.g. what protocols are enabled, what firewall rules are, user management policies, etc.), so its safe to assume its working when it is supposed.

I do have a rare but persistent and intermittent error that appears to show up completely randomly (i.e. I'll do the exact same thing twice and it'll happen just once, for example, and will connect successfully the second time). Screen shot:



Code:
Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	SecureCRT.exe
  Application Version:	7.0.4.537
  Application Timestamp:	51547fb9
  Fault Module Name:	MSVCP100.dll
  Fault Module Version:	10.0.40219.325
  Fault Module Timestamp:	4df2be41
  Exception Code:	c0000005
  Exception Offset:	0000bbf0
  OS Version:	6.1.7601.2.1.0.256.4
  Locale ID:	1033
  Additional Information 1:	0afa
  Additional Information 2:	0afa9aa512456d7fac953b42f00dd032
  Additional Information 3:	e28b
  Additional Information 4:	e28b84ba13ffc6c3bbf3de7963bc3dbc

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
Code:
Problem signature:
  Problem Event Name:	BEX
  Application Name:	SecureCRT.exe
  Application Version:	7.0.4.537
  Application Timestamp:	51547fb9
  Fault Module Name:	StackHash_0a9e
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	00000000
  Exception Offset:	77b1e1e1
  Exception Code:	c0000005
  Exception Data:	00000008
  OS Version:	6.1.7601.2.1.0.256.4
  Locale ID:	1033
  Additional Information 1:	0a9e
  Additional Information 2:	0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:	0a9e
  Additional Information 4:	0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
When I start getting these messages, they tend to appear over and over again as I try to close the window, sometimes appearing on top of each other and sometimes appearing one after the other as I close each window with the "X" or the "close program" button.

Last edited by gunslingor; 07-02-2013 at 10:14 AM.
Reply With Quote
  #5  
Old 07-02-2013, 10:28 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi gunslingor,

Thanks for the post. SecureCRT 7.0.4 is no longer in active development. Do you see the same issue in SecureCRT 7.1.1?

If so, would you post the actual SecureCRT command-line that your Access program is trying to launch when you see the crash?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #6  
Old 07-02-2013, 12:59 PM
gunslingor gunslingor is offline
Registered User
 
Join Date: May 2013
Posts: 27
I uninstalled then reinstalled the new version, the same thing happens. Here the first popup:
Quote:
Problem signature:
Problem Event Name: BEX
Application Name: SecureCRT.exe
Application Version: 7.1.1.264
Application Timestamp: 519d4eb9
Fault Module Name: StackHash_0a9e
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 770ee1e1
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
http://go.microsoft.com/fwlink/?link...8&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
Before I even had a chance to close this one, another popup show'd up with this:

Quote:
Problem signature:
Problem Event Name: APPCRASH
Application Name: SecureCRT.exe
Application Version: 7.1.1.264
Application Timestamp: 519d4eb9
Fault Module Name: StackHash_cc03
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Code: 00000000
Exception Offset: 00000000
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: cc03
Additional Information 2: cc03fd00d3bba63e5f7737cf3800cd74
Additional Information 3: bc5b
Additional Information 4: bc5bc241d1d1b2e82aaca6fb0c68294d

Read our privacy statement online:
http://go.microsoft.com/fwlink/?link...8&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
I then press "Close the Program"... 3 seconds later I get another one:

Quote:
Problem signature:
Problem Event Name: APPCRASH
Application Name: SecureCRT.exe
Application Version: 7.1.1.264
Application Timestamp: 519d4eb9
Fault Module Name: MSVCP100.dll
Fault Module Version: 10.0.40219.325
Fault Module Timestamp: 4df2be41
Exception Code: c0000005
Exception Offset: 00006dd6
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: d663
Additional Information 2: d6638594fe5f248455b16706f10611b0
Additional Information 3: f447
Additional Information 4: f447daf004f77e47a37179c6cec5f116

Read our privacy statement online:
http://go.microsoft.com/fwlink/?link...8&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
After pressing close again, the same one appeared 2 more times... then finally I get no more messages and Secure is CLOSED.

Quote:
If so, would you post the actual SecureCRT command-line that your Access program is trying to launch when you see the crash?
-the command line is in the screenshots above, but restated here:
Code:
Shell "C:\Program Files\VanDyke Software\Clients\SecureCRT.exe /Telnet " & Me.IPList.Column(0, selected_row), vbNormalFocus
When you take away the access shell function you get
Code:
"C:\Program Files\VanDyke Software\Clients\SecureCRT.exe /Telnet " & Me.IPList.Column(0, selected_row)
Me.IPList.Column(0, selected_row) calculates out to an IP address before the shell executes the command.
Reply With Quote
  #7  
Old 07-02-2013, 01:02 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi gunslingor,

Thanks for the update. I apologize for not being clear. I don't need the code you are using (I saw that initially). I need the command-line that is being executed after evaluating the code.

What is the real world command-line that your code is trying to execute?

Are you able to execute the command-line manually?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #8  
Old 07-02-2013, 01:13 PM
gunslingor gunslingor is offline
Registered User
 
Join Date: May 2013
Posts: 27
I don't really know what your asking, but I think I know why. Are you asking "what command are you trying to send via securecrt?"

If so, none. Background: we have all our devices with ip addresses in an access db. Rather than saving sessions and distributing these amongst the office, where they may get out of date, we decided to try to automatically start a session from the db, using the db ip addresses. This is the only thing I'm trying to do... To open sessions using my db as the starting point. Those messages occurred when secure CRT opened, no commands are sent, no scripts are run.

Last edited by gunslingor; 07-02-2013 at 01:19 PM.
Reply With Quote
  #9  
Old 07-02-2013, 02:15 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi gunslingor,

The Shell() call in your code is not trying to execute the following:
"C:\Program Files\VanDyke Software\Clients\SecureCRT.exe /Telnet " & Me.IPList.Column(0, selected_row), vbNormalFocus
The variables are going to be evaluated by the code, and an actual SecureCRT command-line will be executed.

I need to know what the Shell() call is actually trying to execute. Maybe you could assign the command to a variable, and then execute the variable. This would allow you to message box or write to a file the value that is in the variable prior to attempting to execute it.

Does this help to explain what I want to know?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #10  
Old 07-03-2013, 06:55 AM
gunslingor gunslingor is offline
Registered User
 
Join Date: May 2013
Posts: 27
I don't think I have the ability to answer your question. Now your asking, "what is the actual expression executed by the shell function". Without finding the actual shell functional definitions, I cannot answer this definitively, and I've looked online and it doesn't appear to be published.

I have assumed that the precise command run at this point is simply:

Code:
C:\Program Files\VanDyke Software\Clients\SecureCRT.exe /SSH1 [whatever IP address is selected]
then the second argument just maximizes the window thru windows, outside of the command prompt. There are no further details available about how the shell function actual interprets the variables, but I thought this was fairly obvious until you raised the question.

The only other interpretation I can conceive of your request is that you don't understand the statement "Me.IPList.Column(0, selected_row)". If that's the case, just replace that statement with an IP address and your golden.
Reply With Quote
  #11  
Old 07-03-2013, 10:35 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi gunslingor,

To move forward on this issue, send an email to support@vandyke.com with a subject of Attn: Todd - Forum thread #11078.

Please include the operating system you are using.
__________________
--Todd

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

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:46 PM.