Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2016, 02:45 AM
kingboli kingboli is offline
Registered User
 
Join Date: Aug 2016
Posts: 5
Smile Help on using command line to create a session and run scripts in the session

I want to use command-line to auto create a session and then auto run a script in this session. But there is an error about parameter "/SCRIPT" when I use below command in a bat file:

"C:\Users\AppData\Local\VanDyke Software\SecureCRT\SecureCRT.EXE" /SERIAL COM5 /BAUD 115200 /SCRIPT test.py

What should I do to auto create a session and then auto run a script? I do not want any manual settings and operations.

My SecureCRT version is 7.3 and the beginning lines of my script are:

def main():

crt.Screen.Synchronous = True
crt.Screen.WaitForString("=>")
crt.Screen.Send("ls")
....

Thanks
Reply With Quote
  #2  
Old 08-24-2016, 08:40 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,997
Hi kingboli,

You have your command-line options out of order.

The standard option /SCRIPT should come before the *protocol-specific* options.

See this recent post.
__________________
Thanks,
--Brenda

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

Last edited by bgagnon; 08-24-2016 at 08:47 AM.
Reply With Quote
  #3  
Old 08-24-2016, 11:02 PM
kingboli kingboli is offline
Registered User
 
Join Date: Aug 2016
Posts: 5
Smile How to quit?

Hi bgagnon,
Thanks for your help and it works.

There are another three questions, can you help answer them ?
1. I use crt.quit at the end of the main function to close the application, but it is not worked. And it seems crt.quit does not take effect.

2. I want to save logs printed on the SecureCRT's screen, what should I do?

3. I want to append the previous log file with new outputs during the next time's running SecureCRT, that's to say, if I launched 10 time's SecureCRT, I wanted to record the 10 screen outputs to one log file in append mode.

Great thanks for your help.
Reply With Quote
  #4  
Old 08-25-2016, 10:11 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,997
Hi kingboli,

You are welcome.

As to the new inquiries, I see you created another thread with similar questions. We will answer them there since you titled this one "using command line".
__________________
Thanks,
--Brenda

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

Last edited by jdev; 08-25-2016 at 11:24 AM.
Reply With Quote
Reply

Tags
script , session connect


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 07:35 PM.