Topic "VBScript to get file from FTP Server to Local Machine"

Author Message
[View user's profile]

Joined: 2008-03-31
Posts: 1
Location: Mumbai
Can anybody pls give me a VBScript to connect to FTP Server and download files using WinSCP3. I need this whole process to be auomatic without any manual intervention. I tried using the following given on the Website. I wrote this to a text file example.txt

# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open
# Connect
# Change remote directory
cd /home/user
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
get examplefile.txt d:\
# Disconnect
# Exit WinSCP

Thereafter on the Command prompt i called it using:
winscp3.exe /console /script=example.txt

This opens the Winscp GUI Console. But i need to connect to the FTP Server and download the file silently instead of calling the GUI and needing to enter the login details. I need the whole thing to run from VBScript without any manual intervention and get the file to local machine. Is there a different way to do this from command line on Windows or do we need some other setup. I am completely new to this and vbscript. PLas help me out.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26728
Location: Prague, Czechia
First, the "open" and "" on command-line does the same thing. Hence you end up with two connections opened.

If I understand you correctly your only concern is that there is a console window opened while the script is running. To avoid that, just omit the /console command-line parameter.
Martin Prikryl

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License