Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-11-2019, 09:37 AM
GuitarDude GuitarDude is offline
Registered User
 
Join Date: Mar 2019
Posts: 8
Launching to Web Interfaces

Trying to make my job a bit faster. When I open a command line of the device I want to open the Website interface of it as well. Here is what I have now. I'm not sure what I'm missing.
Also I want to have one script and just change the arguments within the properties of the devices to the specific IP.


# $language = "VBScript"
# $interface = "1.0"
' Run.vbs demonstrates how to utilize the Windows Scripting Host (WSH) by using
' its 'Run' method to execute other programs. Note the use of nested quotes to pass
' a path that contains spaces along with command line arguments.

Sub Main
Dim shell
Dim IP
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" https://&IP&:4434"

End Sub
  #2  
Old 03-11-2019, 10:53 AM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 441
Hi GuitarDude,

You can get the IP address of the connected session using the RemoteAddress property of the Session object from SecureCRT's scripting API.

For Example:

Code:
# $language = "VBScript"
# $interface = "1.0"

strRemoteAddress = crt.Session.RemoteAddress

Set shell = CreateObject("WScript.Shell")
shell.Run("http://" & strRemoteAddress)
Does that work for you?

For more information about SecureCRT's scripting API please refer to the Help.
__________________
Thanks,
--Brittney

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
  #3  
Old 03-11-2019, 11:24 AM
GuitarDude GuitarDude is offline
Registered User
 
Join Date: Mar 2019
Posts: 8
Thumbs up Web Interface Script

Quote:
Originally Posted by berdmann View Post
Hi GuitarDude,

You can get the IP address of the connected session using the RemoteAddress property of the Session object from SecureCRT's scripting API.

For Example:

Code:
# $language = "VBScript"
# $interface = "1.0"

strRemoteAddress = crt.Session.RemoteAddress

Set shell = CreateObject("WScript.Shell")
shell.Run("http://" & strRemoteAddress)
Does that work for you?

For more information about SecureCRT's scripting API please refer to the Help.

This does work for me. Thanks for the help. I did change a few things like https and adding the port number.
  #4  
Old 03-11-2019, 11:49 AM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 441
Hi GuitarDude,

Great! I am glad to hear that you are all set! My apologies for failing to include the port number in the example!

Do you run the script every time that you connect to a session?

If so, you can configure a logon script to run the script as soon as you connect in Options > Session Options > Connection > Logon Actions. Simply point to the script in the "Login Script" field.

If you do not wish to run the script every time that you connect, you can map a button on your Button Bar to run the script as you please.

For more information please refer to our YouTube video:

https://youtu.be/qp82UWxGB8I
__________________
Thanks,
--Brittney

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

Last edited by berdmann; 03-11-2019 at 12:08 PM.
  #5  
Old 03-11-2019, 12:20 PM
GuitarDude GuitarDude is offline
Registered User
 
Join Date: Mar 2019
Posts: 8
Web Interface Script

Looking into the button bar a little I just thought of another helpful button. It would be pinging the current session. What is the shell run for that.
  #6  
Old 03-11-2019, 03:47 PM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 441
Hi GuitarDude,

Correct me if I am mistaken, but it sounds like you are trying to ping the remote that you are connected to. Is that correct?

Can you tell me more about the problem that you are trying to solve or the goal that you have as it relates to pinging the "current session"?
__________________
Thanks,
--Brittney

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Closed Thread

Tags
scripts , website

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 08:17 AM.