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 03-13-2011, 09:28 PM
xujunmao xujunmao is offline
Registered User
 
Join Date: Mar 2011
Posts: 27
Question Find a solution for parallel

First,introduce my work environment is the use of WINDOWS XP or windows
2000 and Serial protocol mainly used on the secureCRT, My script needs to achieve:
1). Create a main session (Main), other established Multiple sessions(com1, com2 ... ...com N), for testing activities.
2), In addition to the main session, the others need to operate independently of each session run a script file.the main session is used to display the results of running another session.


On the first point has been well implemented, while the second did not find the perfect solution, now run the script by manually is possible, and how to use a script to achieve it?


The current status is: the script can only be one after another session to complete, That com1 run script 1 is completed, then the com2 run script 2
, This work, for our tests are very unfavorable.


I need to com1, com2 ... ... com N, preferably simultaneously or nearly parallel to work .and how can I ,Any help would be most appreciated.



Also, how to use "SecureCRT.exe / S My_Pre- configured_Session_Name", I have never succeeded. could you Provide a Practical examples? Of course, the hope is that the example on the serial

Thank you,
-jimmy
Reply With Quote
  #2  
Old 03-14-2011, 01:06 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hello Jimmy,

I am not crystal clear on what you are trying to accomplish. I will provide some general information based on my current understanding and then, you can correct me as necessary.

Quote:
the main session is used to display the results of running another session.
This can be achieved, in a way, by using the example script I have provided. It is more of a "pseudo" parallel method of achieving the end result since you can't currently paint the screen of the main session with results from another session.

There's also this thread with a version of the script that writes the results to a file.


Perhaps, a better way, is to have the com1 ... comN sessions in a folder and then open the entire folder in tabs with an argument on the command-line that causes the desired script to execute in all sessions. For example:
Code:
SecureCRT.exe /T /S <folder_of_sessions> /Script MyScript
The correct order of command-line options and the exact syntax can be found in the SecureCRT help topics listed below:
  • Using the Software / Command-Line Options / Overview of Command-Line Options
  • Using the Software / Command-Line Options / Table of Standard Command-Line Options
  • Using the Software / Command-Line Options / Table of Protocol-Specific Command-Line Options

I have also attached an example that uses logging to accomplish a similar objective. We have posted many variations of that script in several threads on the forums also (read data from host file, send commands from commands file, log results).

The final resource I recommend is the VB scripting manual available here. It covers many concepts that our customers use frequently with regards to VB Scripting and SecureCRT.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 03-15-2011, 02:44 AM
xujunmao xujunmao is offline
Registered User
 
Join Date: Mar 2011
Posts: 27
HI,Brenda

Thanks for looking into that. It will take me some time to understand what this script actually does ,and this script seems to gave me a little help .

However, I need the ability is Similar as the chat window’s sent chat to all tabs,it looks more like a real work in parallel.

In order to describe more clearly my needs, I give an instance of manual.

Let's say that I have 2 devices,one connected com2 and the other connected com3,Each emulation simulated one device and create a session,



This picture shows a Serial-COM2 is running a script and we need the
Serial-COM3 can run the other's script at the same time.


How can I use the VBScript to achieve it?thanks!
Attached Images
File Type: jpg pic1.jpg (32.7 KB, 673 views)
File Type: jpg pic2.jpg (21.3 KB, 568 views)
Reply With Quote
  #4  
Old 03-15-2011, 11:07 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hello Jimmy,

As described in my prior post, the only way you can run the same script in multiple tabs is from the command-line. Even then, the execution of the script will not be truly parallel as it depends on connection time and other factors.

You can determine the location of your config folder from the General category of SecureCRT's Global Options. Inside that folder is a Sessions subfolder. Here is where you would want to make an "enclosing folder" for your existing sessions. In your command-line, you only need to provide the location from the "Sessions" subfolder onward (deeper levels). If spaces are present in the folder name, quotes are necessary:

Windows 7 default configuration folder location (with a common profile chosen at installation):
C:\Users\<Username>\AppData\Roaming\VanDyke\Config
So your new folder location might be:
C:\Users\...\Config\Sessions\Jimmy Com Sessions
If you place the sessions in a folder and then open the entire folder in tabs with an argument on the command-line, what are the results?

Code:
SecureCRT.exe /T /S "Jimmy Com Sessions" /Script <path_to_script>
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 03-16-2011, 12:33 AM
xujunmao xujunmao is offline
Registered User
 
Join Date: Mar 2011
Posts: 27
yes , thanks !
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 12:44 AM.