View Single Post
Old 07-30-2012, 12:36 PM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,635
Hi emailsbecker,

When you choose File / Log Session, if the Terminal / Log File category of SecureCRT's Session Options is configured with a valid log path, it will be used unless the Prompt for filename option is enabled

However, the user will always be prompted for a log file name if the session option Log file name is blank.

This line in your code changes Session Options so that the log file name is no longer blank:

crt.Session.LogFileName = logfile
One way to restore the blank log file name is shown in the code sample below.

This has the added benefit that if the user does already have a custom log file name, running your script will not wipe out their configuration.

strOrigLogFilename = crt.Session.Config.GetOption("Log Filename")
crt.Session.LogFileName = logfile
crt.Session.Log False
crt.Session.Log True
crt.Session.Config.SetOption "Log Filename", strOrigLogFilename
The above has been tested in SecureCRT version 7.0. If you are running an older version of SecureCRT, you may need to upgrade to use this solution.

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