Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-22-2020, 06:29 PM
oko oko is offline
Registered User
 
Join Date: Feb 2020
Posts: 6
Run a command or script after login, connect, etc.

Where do I put such command or script for Protocol: “Local shell” type?
Specifically, Anaconda3 shortcut is:
Code:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)\Anaconda Prompt (Anaconda3).lnk
it runs following command:
Code:
%windir%\System32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
If I replace "Local shell" | "Shell path" with:
Code:
%windir%\System32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
I'll get an error...

I cannot put these two lines into "Login actions" | "Logon script/arguments" either:
Code:
C:\ProgramData\Anaconda3\Scripts\activate.bat
C:\ProgramData\Anaconda3
The only way to do it is via Automate logon | expect/send.
It's very confusing...

Is there a better way?
Reply With Quote
  #2  
Old 02-23-2020, 11:50 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,325
Hi oko,

It is not clear to me what you are attempting to accomplish.

Are you trying to use Anaconda3 as the local shell?

Please elaborate on your objective.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 02-23-2020, 10:53 PM
oko oko is offline
Registered User
 
Join Date: Feb 2020
Posts: 6
Brenda,
Quote:
Originally Posted by bgagnon View Post
Are you trying to use Anaconda3 as the local shell?
Somewhat.
Basically, I have a local shell (with "Shell path" set to C:\Windows\System32\cmd.exe)
I’m want to auto start Anaconda3 when I connect to it.
“auto start Anaconda3” is to “auto execute” following command:
Code:
C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
Reply With Quote
  #4  
Old 02-24-2020, 09:54 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,325
Hi oko,

I have added this thread to a feature request in our product enhancement database to add the ability to pass command-line arguments to local shell process. Should a future release of SecureCRT include this feature, notification will be posted here.

If you prefer direct email notification, send an email to support@vandyke.com and include Feature Request - Forum Thread #14085 in the subject line or use this form from the support page of our website.

What you might do in the meantime is create a wrapper batch file that calls your batch file that invokes the application with the arguments. Then in SecureCRT's Quick Connect dialog, when you choose Local Shell, use "..." to browse to the wrapper batch file as your shell.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 02-24-2020, 10:09 AM
oko oko is offline
Registered User
 
Join Date: Feb 2020
Posts: 6
Brenda,
Quote:
Originally Posted by bgagnon View Post
Hi oko,
What you might do in the meantime is create a wrapper batch file that calls your batch file that invokes the application with the arguments. Then in SecureCRT's Quick Connect dialog, when you choose Local Shell, use "..." to browse to the wrapper batch file as your shell.
I did it already via Automate logon | expect/send dialog.
Just wait for a prompt and send Anaconda3 script commands.
Easy enough, but was looking for better way to do the same.
Thanks!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 04:42 AM.