Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

jmsmny

session log files

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)