sftp file tranffer using vbscript

Kemoy Leslie 1 Reputation point
2022-06-16T13:24:33.847+00:00

i want to copy some .csv files from a sftp server to a local folder is there a way to do this using vbs?

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
1,845 questions
{count} votes

2 answers

Sort by: Most helpful
  1. David Broggy 3,976 Reputation points MVP
    2022-06-16T13:32:23.377+00:00

    how about this:

    Dim objFSO
    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Dim objFile
    Set objFile = objFSO.GetFile("C:\file.txt")

    Dim strNewPath
    strNewPath = "\server\folder\"

    objFSO.CopyFile objFile, strNewPath


  2. MotoX80 23,651 Reputation points
    2022-06-25T22:44:42.577+00:00

    I would recommend using Powershell instead of VBS.

    https://adamtheautomator.com/powershell-sftp/

    No comments