View Single Post
  #2  
Old 10-08-2012, 03:26 PM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,039
Hello,

Before reviewing and testing your code to see if I can spot the issue, I'd like to mention the SecureCRT scripting manual. Section 7.1, Logging with SecureCRT's Session Object, seems like a good place to start.

I see that the code you posted enables logging before the log file name is set.
Code:
objCurrentTab.Session.Log True,False,True
objCurrentTab.Session.LogFileName = "c:\1ftp\rush\"&PORTS&"_%Y%M%D%h%m%s%t.txt"
That seems like a problem.

The SecureCRT scripting manual (p. 85) shows disabling logging before setting the log file name. Start logging after the filename is changed.
Code:
If crt.Session.Logging Then
    ' Turn off logging before setting up our script's
    ' logging...
    crt.Session.Log False
End If

' Set up the log file so that it resides in the path
' defined in the TEMP environment variable, and is
' named according to the remote IP address:
crt.Session.LogFileName = "%TEMP%\" & _
"LogFileForIP(" & crt.Session.RemoteAddress & ").txt"
crt.Session.LogUsingSessionOptions
' Send commands, etc.
' ...
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote