Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #16  
Old 04-21-2016, 02:46 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 40
Today I tried it on another computer and still had no luck.

Here's how the setup looks on my PC:

And yes, I am on Windows 10 64bit.
Attached Images
File Type: png screen 2016-04-21 10.41.47.png (8.9 KB, 296 views)
Reply With Quote
  #17  
Old 04-21-2016, 07:26 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 40
Quote:
Originally Posted by jdev View Post
I've verified that this (%C as a substitution for Configuration folder) works for me in SecureCRT 8.0. I've tried 6 minus 3 ways from Sunday to get it to fail, all my failure attempts have been successes using %C as it's correctly substituted for the configuration folder for SecureCRT (as long as I'm using a version of SecureCRT 7.0 and newer).

I'm running on Windows 10, 64-bit.

What OS are you running on?


--Jake
I can confirm that %C works as a substitute for configuration folder path in logon scripts, but it does not work for me in Mapped Keys (Run Script) or Buttons (Run Script).
Reply With Quote
  #18  
Old 04-21-2016, 09:59 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 936
Quote:
Originally Posted by vysh View Post
I can confirm that %C works as a substitute for configuration folder path in logon scripts, but it does not work for me in Mapped Keys (Run Script) or Buttons (Run Script).
The way you original posted made it seem that it wasn't working for you as a component of your login script, so I appreciate you providing clarification.

The context of this thread is specific to login script, not mapped keys or button bar definitions. %C is currently implemented as a substitution only for login scripts.

You're wanting %C as a substitution for configuration folder when you have a path specified and your action/function with either a mapped key or button bar definition is Run Script, right?

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #19  
Old 04-22-2016, 12:56 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 40
Quote:
Originally Posted by jdev View Post
You're wanting %C as a substitution for configuration folder when you have a path specified and your action/function with either a mapped key or button bar definition is Run Script, right?

--Jake
Yes, that's correct.
Reply With Quote
  #20  
Old 04-22-2016, 11:32 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 936
Quote:
Originally Posted by vysh View Post
Yes, that's correct.
OK. I've created a feature request for you. We'll post to this thread if support for %C is made available for Run Script paths in mapped keys and button bar definitions. If you'd like to receive email notification directly, send email to support@vandyke.com with a subject of "ATTN: Forum #7039 - %C for MappedKeys & ButtonBar"

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #21  
Old 04-26-2016, 04:30 AM
plissje plissje is offline
Registered User
 
Join Date: Apr 2016
Posts: 2
Hi guys,
Quick question regarding this as well. Is it possible to somehow get this value for a login script as well?
Reply With Quote
  #22  
Old 04-26-2016, 05:00 AM
plissje plissje is offline
Registered User
 
Join Date: Apr 2016
Posts: 2
Hi guys,
Is there a way to actually use this %C in a login script as well?
Talking about having it in the actual code, not the path.
Reply With Quote
  #23  
Old 04-26-2016, 10:44 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 936
Quote:
Originally Posted by plissje View Post
Is there a way to actually use this %C in a login script as well? Talking about having it in the actual code, not the path.
%C isn't something that automatically gets substituted in script code, and it wouldn't be something that would be handled in every script call you could possibly make.

However, you can obtain the path to your configuration folder if you're running SecureCRT on Windows like this:
Code:
Sub Main()
    strConfigPath = GetConfigPath
    crt.Dialog.MessageBox("Config path:" & vbcrlf & vbcrlf & strConfigPath)
End Sub

' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function GetConfigPath()
    Set objShell = CreateObject("WScript.Shell")
    On Error Resume Next
    strConfigPath = objShell.RegRead("HKCU\Software\VanDyke\SecureCRT\Config Path")
    strConfigPath = objShell.ExpandEnvironmentStrings(strConfigPath)
    On Error Goto 0
    If strConfigPath = "" Then
        Err.Raise -2147221504 + 1000, _
            "SecureCRT's configuration path not found in the registry.", _
            "Unable to locate SecureCRT's configuration folder in HKCU." & _
            vbcrlf & vbcrlf
        Exit Function
    End If

    GetConfigPath = strConfigPath
End Function
Is this what you're looking for?

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #24  
Old 01-09-2019, 05:25 PM
dkrupicka dkrupicka is offline
Registered User
 
Join Date: Dec 2007
Posts: 1
Talking +1 for me on this feature request.

Quote:
Originally Posted by jdev View Post
OK. I've created a feature request for you. We'll post to this thread if support for %C is made available for Run Script paths in mapped keys and button bar definitions. If you'd like to receive email notification directly, send email to support@vandyke.com with a subject of "ATTN: Forum #7039 - %C for MappedKeys & ButtonBar"

--Jake
+1 for me on this feature request. I use the button bar for a lot of my scripts. However, I run SecureCRT in portable mode as I move to and from different machines a lot. Thus, the path to my script files (and files I call within the scripts) change a lot. If I could put the %C into the button bar, it would make my life a lot easier.
Reply With Quote
  #25  
Old 11-07-2019, 12:22 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,015
Hi all,

A feature similar to what has been requested in this thread has been implemented in a pre-release build version of SecureCRT.

Since v7.2.x, SecureCRT has supported templated paths to aid in cross-platform situations, see this post.

That functionality previously did not extend to paths (even though they may be a well-known path, such as the Config path or a subfolder of it) configured in mapped buttons or keys. Now it does.

If interested in trying the pre-release, send an email to support@vandyke.com and include Feature Request - #7039 (or similar) in the subject line.

Since your download account is how we make pre-releases available, if you are not writing us from the email address associated with that account, please include that info in the body of the email.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
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 08:30 PM.