View Single Post
Old 03-15-2013, 12:02 PM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,524
Hi Dustin,

Congrats on the success incorporating argument processing into your script!

For new question #1, I think there is a snippet of code that's available in our Scripting Essentials manual that will help.

You can add code to "detect the prompt" as illustrated in section 7.2 ( search for word heuristically, guaranteed to only appear once )

If you incorporate that into the proposed IF statement, I don't think you would need the second script.

However, to answer your actual question, there is a WaitForStrings() (plural) method available to the Screen object, but you would probably have to use regular expressions to handle any situation where what you are waiting for is expressed via a "wildcard".

2. Is there a way I can have the session log filename to have the name of the CustomerDeviceName instead of the Jumpserver Hostname\Jumpserver Session name? Currently in my default settings I have the log file name set to be C:\%H-%S-%M-%D-%Y-%h-%m.log The problem is that when using the command-line option with script above, it names the log file as JumpserverHostname-JumpserverSessionName. I would like each of the log files to include the customer device name, not the jumpserver device name. Is there a way value I could set in the LogfileName that would use the /N "CustomerDeviceName" which is specified in the command-line options? If not, is there a command-line argument that I could set or something in the vbs file I could set to accomplish this?
For #2, you could enable logging in the script instead.

The CustomerDeviceName is already stored in the crt.Arguments(1) variable, so you have the necessary information.

See the attached example script.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote