Topic "session log files"

Author Message
jmsmny
[View user's profile]

Joined: 2014-05-09
Posts: 3
I'm using VBScript to automate an sftp process. I need help creating a session log file for each session. Thanks for your help.

sFTPScript = sFTPScript & "option echo on" & vbCRLF
sFTPScript = sFTPScript & "option batch on" & vbCRLF
sFTPScript = sFTPScript & "option confirm off"& vbCrLf
sFTPScript = sFTPScript & "option transfer binary" & vbCrLf
sFTPScript = sFTPScript & "open sftp://" & "userid" & ":" & "password" & "@" & "xx.xx.xxx.xxx" & " -privatekey=D:\Spool\VBControl\Policy_FTP\DPS_Oxford.ppk" & vbCrLf
sFTPScript = sFTPScript & "cd /Policies" & vbCrLf
sFTPScript = sFTPScript & "put " & fromFolder & "\*.pdf" & vbCRLF
sFTPScript = sFTPScript & "close" & vbCrLf
sFTPScript = sFTPScript & "exit" & vbCrLf

Set oFTPScript = oFTPScriptFSO.CreateTextFile(sFTPTempFile, True)
oFTPScript.WriteLine(sFTPScript)
oFTPScript.Close
Set oFTPScript = Nothing

sCmd = """C:\Program Files\WinSCP\WinSCP.com"" -script=" & sFTPTempFile
sError = oFTPScriptShell.run (sCmd, 0, true)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Use command-line parameter /log:
http://winscp.net/eng/docs/commandline

Alternatively you may consider using WinSCP .NET assembly and its Session.SessionLogFile:
http://winscp.net/eng/docs/library
http://winscp.net/eng/docs/library_com_wsh
http://winscp.net/eng/docs/library_session
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License