Prompt Variable

Questions, comments, and suggestions related to Typeitin.
Post Reply
laurencew
Posts: 2
Joined: Fri Feb 05, 2021 7:20 am

Prompt Variable

Post by laurencew » Fri Feb 05, 2021 7:32 am

Dont know if I'm just being complete idiot but cannot get prompt variable to work for me

I'm using TypeItIn to insert my user credentials into securecrt sessions

For telnet session its not a problem as telnet prompts you for username and password, so I just telnet to a device and use typeitin to insert credentials.

Problem is for for SSH session you need to specify the username to use before conencting to remote device, eg ssh myusername@remotehotehost

I am trying to get typeitin to prompt me for the remote host name, which I managed to get working with ssh myusername@{Var=?Prompt}
problem is that even though the prompt pops us and I can insert the name of the remote host, the info never gets pasted into the securecrt session after clicking ok, the script just tries to carry on with the {Enter}mypassword{Enter} so obviously its not working as remote host is never specified

Wavget
Site Admin
Posts: 63
Joined: Wed Jan 16, 2019 4:32 pm

Re: Prompt Variable

Post by Wavget » Fri Feb 05, 2021 10:30 am

The {Var=?Prompt} stores the input into a variable. You need to use a variable function to type the contents of the variable.

Example: {var1=?Username}{Var1}{Enter}password{Enter}

{var1=?Username} displays the input dialog and saves the response to variable #1.

{Var1} types the contents of variable #1.

laurencew
Posts: 2
Joined: Fri Feb 05, 2021 7:20 am

Re: Prompt Variable

Post by laurencew » Tue Feb 09, 2021 4:38 am

Thanks for the response but that will not work for me, i have over 3000 devices with unique names, so I cannot create a variable for each of them, I was looking for an option where the program would prompt me to input the device name and types my answer into the console(just BTW my username and password will remain the same so no need for variable), so I had something like below, but as you say the prompt does not perform the function I am after, so guess its back to doing it manually

ssh myusername@{Var=?Prompt}{Enter}mypassword{Enter} ------- was expecting the the results of what I typed into the popup for Var=?prompt to be typed into the console

Wavget
Site Admin
Posts: 63
Joined: Wed Jan 16, 2019 4:32 pm

Re: Prompt Variable

Post by Wavget » Tue Feb 09, 2021 8:30 am

The prompt response is only stored in the variable for the duration of the button, so one variable will work for all your devices.

{Var1=?Prompt}ssh myusername@{Var1}{Enter}mypassword{Enter}

Post Reply