using vbs to connect sftp and use "put" command
Hi! I am new to to scripting and WinSCP. I need to create a script to connect to a ftp service and copy files to it. I've tied the following with no success. Please help!!!
Dim wshShell
Dim sftpcmd
Set wshShell = WScript.CreateObject("WScript.Shell")
sftpcmd = "winscp /console /command " & """open sftp://nstcn61:password@10.10.1.100 -hostkey= ssh-rsa 1024 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX" & "put c:\sysaudit\*.*" & "close""" & " " & """exit"
wshShell.Run(sftpcmd),1,true
wscript.sleep(20000) 'wait for 20 seconds until sftp is done
Any help would be appreciated.
Dim wshShell
Dim sftpcmd
Set wshShell = WScript.CreateObject("WScript.Shell")
sftpcmd = "winscp /console /command " & """open sftp://nstcn61:password@10.10.1.100 -hostkey= ssh-rsa 1024 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX" & "put c:\sysaudit\*.*" & "close""" & " " & """exit"
wshShell.Run(sftpcmd),1,true
wscript.sleep(20000) 'wait for 20 seconds until sftp is done
Any help would be appreciated.