#1
|
|||
|
|||
How to code Rows and Cloumns using .vbs script
Hi There,
I have a problem in setting up rows and columns using script with extension .vbs. I tried most possible options but still not able to setup secureCRT screen rows (24) and columns (80). I am using this version of secureCRT : Version 6.5.0 (build 380) Any help will would much appreciated. |
#2
|
|||
|
|||
Hi vensas3181,
I'm sorry you are having trouble. Is there a reason you wish to set it from a script rather than the Session Options? What problems are you having when you attempt to make the change? Typically something like the below would work: Code:
# $language = "VBScript" # $interface = "1.0" crt.session.config.setoption "Rows", 50 crt.session.config.setoption "Cols", 100 When you connect a session, the window will resize based on the settings in that session regarding rows/columns and the "On resize" configuration. When not connected, SecureCRT should be getting that info from the Default Session. Those configuration options are found in the 'Terminal / Emulation' category of Session Options (or Default Session): https://www.vandyke.com/support/tips/defaultset.html Every connection from then on, if you are connecting sessions in tabs, is also going to be controlled by the configuration in that first tabbed session. This will mean if you have multiple sessions opened and you try to set the rows/columns for a tab other than the first tab it will not have an effect.
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 Last edited by ekoranyi; 05-16-2017 at 08:21 AM. |
#3
|
|||
|
|||
Does it mean that, we need not start session before it start script execution or if we start SecureCRT then it will default to that session option's rather than config settings placed in .vbs script rite?
![]() |
#4
|
|||
|
|||
Hi vensas3181,
No, not exactly. When using tabs in SecureCRT the first tab controls the size of the window. When setting the window size with a script any changes to the first tab will affect all the other tabs. Trying to make changes to any tab other than the first will not work because the first tab controls the window size. What are you trying to accomplish, it may be easier to just set the rows/columns in the sessions options manually.
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
Hi, Thanks for your support it did worked in different way. Now I am having issues while using below code. Could you please let me know am I missing anything
Code ----- Set objFSO = CreateObject("Scripting.FileSystemObject") Set objStream = objFSO.OpenTextFile("C:\Users\vschi420\Desktop\SecureCrt\sessionlog.txt", ForWriting, True) Error ----- Invalid procedure call or argument |
#6
|
|||
|
|||
Hi vensas3181,
It looks like there is a syntax error with how the file is being opened. Instead of using ForWriting you would use a number 2. See below: Code:
# $language = "VBScript" # $interface = "1.0" Set g_fso = CreateObject("Scripting.FileSystemObject") Set objFile = g_fso.OpenTextFile("C:\Users\TestUser\Desktop\test.txt", 2, True) objFile.Write "this is a test" objFile.Close ForReading = 1 - Opens a file for reading only ForWriting = 2 - Opens a file for writing. If the file already exists, the contents are overwritten. ForAppending = 8 - Opens a file and starts writing at the end (appends). Contents are not overwritten. Does this help?
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#7
|
|||
|
|||
Many thanks... your rock star and have all possible options available with you for solutions. It worked for me.
Now, My next query is as below, I have screen rows and columns like below, (there are many rows for each transaction status type). Status Date Name CXL 04/15/17 TestOne 324 04/12/17 TestTwo RES 04/13/17 TestThree CXL 04/10/17 Testonemius 456 04/11/17 Something. I am using below code to fetch each transaction status type and I should be clicking on all selected require transaction's until all require transactions are processed.. (same time I need to write this list into output file). Could you please help me in this ?? I am not able to get what I want using below code If InStr(nvalue,"CXL")<>0 Then i = 6 For i = 6 To 25 nProcesses = crt.Screen.Get(i,43,i,75) nextline = crt.Screen.Get(i+1,43,i+1,75) If InStr(nProcesses,"CXL") <> 0 Then ' MsgBox nProcesses CreateObject("WScript.Shell").Popup nProcesses, 1, nProcesses crt.Screen.Send chr(27) & "D" 'nRow = crt.Screen.CurrentRow nvalue = crt.Screen.Get(nRow,43,nRow,75) msgbox nvalue End If Next |
#8
|
|||
|
|||
Hi vensas3181,
I'm glad that helped. I think I need a little more information about what you are trying to accomplish. When you say you "should be clicking on all selected require transaction's" what does that mean? Is this a menu and you have to use a combination of keys to select each entry? Can you provide an example of what data, and formatting you want in the output file.
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#9
|
|||
|
|||
Hi Eric,
Here is what I want do as per table provided previously, 1. Identify all transaction (i.e CXL) from the list though they're on same menu . means there could be second, third or so on pages where CXL transaction rows may present. Max is 5 pages 2. Write all CXL transaction rows into output file or write all different transaction rows in to file 3. Select the same type of transaction(s) one by one and enter on that transaction. Then it will open other screen where I need to perform some data input to submit the transaction. 4. Once, record submitted cursor will come back to the transaction screen to pick next transaction line for same transaction and follow Step#3 5. Step#4 and Step#3 will repeat until all transactions related CXL are completed. This is output file code I am using to write the require information in output file, Set g_fso = CreateObject("Scripting.FileSystemObject") Set objStream = g_fso.OpenTextFile("C:\Users\vschi420\Desktop\SecureCrt\sessionlog.txt", 2, True) |
#10
|
|||
|
|||
Hi vensas3181,
It may be beneficial if you could provide some logging of you completing a couple of example transactions manually with raw logging enabled. We try to keep logs out of the forums to avoid potentially exposing sensitive data. Can you take the following steps and email the log that is generated to Support@VanDyke.com with "Attn: Eric forum post 12701" in the subject? To create a raw log in SecureCRT:
__________________
Thanks, --Eric VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#11
|
|||
|
|||
Hi Eric,
I sent log to you as suggested. Please check and let me know your suggestions Regards Venkata |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|