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

Author Message
palakksa
[View user's profile]

Joined: 2008-03-31
Posts: 1
Location: Mumbai
Hello,
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 user:password@example.com
# Connect
open user@example.com
# 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
close
# Exit WinSCP
exit

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

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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
First, the "open user@example.com" and "user@example.com" 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
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