View Single Post
Old 06-04-2016, 10:17 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,093
When Synchronous is set to True, SecureCRT does not display any data to the terminal screen until you call WaitFor*() or ReadString().

What's happening in your case is you've told SecureCRT's script engine to send a command, and immediately after sending that command, you've told SecureCRT's script engine to turn off Synchronous and then turn off logging.

Since you haven't waited for the data to arrive (and be displayed to the terminal screen), there's nothing (or perhaps very little, if anything) that gets logged because you told SecureCRT to stop logging. This happens in script code so quickly that either no data has even arrived yet from the device, or it has but since Synchronous is still set to True when it does arrive, and none of it has been displayed to the screen (and therefore isn't available to be logged).

You can solve the problem by adding a crt.Screen.WaitForString("Put_Your_Shell_Prompt_Here") line right before you turn off Synchronous.

If you're having trouble figuring out how to automatically determine what your shell prompt is on the remote device, either a) try to use something that's unique enough that it wouldn't show up in the command output, but the same on all your different devices, or b) read about heuristically determining the shell prompt as described in the SecureCRT Scripting Guide (see example code on pages 92 and 114 as a good starting point).

Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:
Reply With Quote