Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

martin

You can use command "call" with proper remote-side command.
Guest

Hi Prikryl,

Thanks!

I would like to know when using WINSCP i login to a server and I would like to list all the folders to a text file and get the file to the local machine from where the script is run

Can this be done?

thanks
Chandru
martin

Re: Prompting for password

Well as you do not have a password in the script, it needs to prompt for a password.
Chandru

Prompting for password

Hi,

When i use the script below it is prompting for the password.

# 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
# Connect as a different user
open user2@example.com
# Change the remote directory
cd /home/user2
# Upload the file to current working directory
put d:\examplefile.txt
# Disconnect
close
# Exit WinSCP
exit

From my understanding it should login into the server and get the file.

regards
Chandru