Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > General

Thread Tools Display Modes
Old 05-17-2019, 10:49 AM
Reno Reno is offline
Registered User
Join Date: Mar 2019
Posts: 35
SecureCRT Send String Button

I have a large number of Send String Button Bar Buttons.

Without using buttons that run script files (Send String buttons only), is there any way that you could have a shared password that any Send String button can use in the send string?

Say I have something like 50 buttons and each one needs a Sudo and a password to work. It would be nice if you could have something like a shared global variable that could be referenced in the Send String (like: sudo su \r $my_password \r SOME_COMMAND \r).

Thanks, just wanted to check. I think what I'm asking is if there can be globally stored variables that can be inserted into send string buttons. Thank you.
Reply With Quote
Old 05-17-2019, 12:25 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 998

There isn't a global substitution database that use can use for the purpose you have in mind.

I've created a feature request for you, and we'll post here if a version of SecureCRT ever does become available with such a substitution database built in.

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
Old 06-05-2019, 11:15 AM
gregg gregg is offline
Registered User
Join Date: Oct 2010
Posts: 53

You can cheat in 2 different ways.

1. In the button bar, \v pastes the current clipboard. If you have your password in the clipboard, great! If something else in there, things can go horribly wrong. But it's useful.

2. Instead of Send String, use Run Script and for Arguments, pass the sudo text.

Something like:

# $language = "Python"
# $interface = "1.0"

PASSWORD = "swordfish!"

def main():
    args = crt.Arguments
    arg_list = ["sudo"]
    for idx in range(args.Count):

    text = " ".join(arg_list)

    screen = crt.GetActiveTab().Screen

    if screen.WaitForString("Password:", 5, True):
        screen.Send(PASSWORD + "\n")

Reply With Quote

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:13 AM.