VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Get Options? (https://forums.vandyke.com/showthread.php?t=13567)

ssetbob7 05-29-2019 04:35 PM

Get Options?
 
Is there a list of objConfig.GetOption("xxxxx") options? Or maybe a printout of all options for a session? And are some not changeable, meaning read-only?

Thanks!

jdev 05-29-2019 05:06 PM

Quote:

Originally Posted by ssetbob7 (Post 51603)
Is there a list of objConfig.GetOption("xxxxx") options? Or maybe a printout of all options for a session? And are some not changeable, meaning read-only?

Option names are discovered by looking underneath the hood in the Sessions subfolder of SecureCRT's Configuration folder. Open the Default.ini file (but don't make any changes... you don't want to corrupt it) and you'll see the format as in...
Code:

.
.
.
S:"Hostname"=
S:"XAuthority File"=
S:"XServer Host"=127.0.0.1
D:"Enforce X11 Authentication"=00000001
D:"Request Shell"=00000001
S:"Keyboard Interactive Prompt"=ssword
D:"Disable Initial SFTP Extensions"=00000000
D:"Max Packet Size"=00001000
S:"Firewall Name"=None
S:"Sftp Tab Local Directory V2"=${VDS_USER_DATA_PATH}
S:"Output Transformer Name"=UTF-8
D:"Use Global ANSI Colors"=00000001
S:"Sftp Tab Remote Directory"=
S:"Username"=myusername
.
.
.

S: represents a string value -- name is in ""s.

D: represents a DWORD value -- name is in ""s. These are not only for numeric values, but also for:
  • true|false values (0=false/off; 1=true/on)
  • tri-state values (0=false/off; 1=true/on; 2=defer-to-global-option's-value), and
  • radio button values (0=top-most option; 1=next-option-after-that; 2=next-option-after-that, etc.).

B: represents a binary value. These cannot be set from within a script, nor can they be manually edited.

Z: represents a multi-line string value. For example "Description" sets the text of the "Description" field in Session Options.

Yes, there are some fields that cannot be changed.

What, specifically, are you looking to accomplish?

--Jake

ssetbob7 05-29-2019 05:35 PM

Trying to change the scroll buffer of a session is my current goal.

jdev 05-29-2019 05:56 PM

Quote:

Originally Posted by ssetbob7 (Post 51605)
Trying to change the scroll buffer of a session is my current goal.

You can change the size of the scrollback buffer.

Is this something you're looking to do on an one-time basis, or are you looking to make it large at times, smaller in other occasions, etc. ?

VBScript - Set current session's scrollback:
Code:

crt.Session.SetOption "Scrollback", 128000 'As large as it can be.

Python - Set current session's scrollback:
Code:

crt.Session.SetOption("Scrollback", 128000)
If you want it to be a specific value all the time for all connections (saved or ad hoc), you should consider editing the Default session to change it for all connections in one fell swoop -- never mind the scripting. You can employ the power of editing the Default session to make these changes to all of your existing and future sessions. Here are some links to a tip and a video that provide more details about using the Default session to make mass changes to multiple sessions:
https://www.vandyke.com/support/tips/defaultset.html
https://www.youtube.com/watch?v=5RbuZn9L48g
Note: In order for a "change" to be applied to all other sessions, the Default session's option/field you're targeting must actually be modified/different from its current value. This means that if the targeted field you want to apply to all other sessions is already set to the value you want, you must first change it to something different (and apply that "change") and then edit the Default session again to set the option to its desired value (and apply that "change").


All times are GMT -6. The time now is 02:01 PM.