Topic "getting the remote directory listing into a local file"

Author Message
sy27295
[View user's profile]

Joined: 2013-12-04
Posts: 12
Location: Boston, USA
Suppose I login with this

"C:\Program Files (x86)\WinSCP\WinSCP.com" /command "option batch abort" "option confirm off" "open sftp://UserName:Password@site.sftpSite.com"

what next command can get the directory into a local file
winscp>dir e:\data\dir.txt
or
winscp>dir > e:\data\dir.txt

or, can it be something like this
"C:\Program Files (x86)\WinSCP\WinSCP.com" /command "option batch abort" "option confirm off" "open sftp://UserName:Password@site.sftpSite.com" "cd \OUT" "dir e:\data\dir.txt"

Should it be \console or \command
sy27295
[View user's profile]

Joined: 2013-12-04
Posts: 12
Location: Boston, USA
NOT WORKING ..... in command line

winscp>dir e:\data\dir.txt
or
winscp>dir > e:\data\dir.txt


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sy27295 wrote:
Suppose I login with this

"C:\Program Files (x86)\WinSCP\WinSCP.com" /command "option batch abort" "option confirm off" "open sftp://UserName:Password@site.sftpSite.com"

what next command can get the directory into a local file
winscp>dir e:\data\dir.txt
or
winscp>dir > e:\data\dir.txt

or, can it be something like this
"C:\Program Files (x86)\WinSCP\WinSCP.com" /command "option batch abort" "option confirm off" "open sftp://UserName:Password@site.sftpSite.com" "cd \OUT" "dir e:\data\dir.txt"

Should it be \console or \command
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
You cannot redirect an individual script commands to a file. You can:
- Redirect whole WinSCP output to a file: winscp.com /command ... > out.txt
- Redirect remote command to a remote file and download it: call ls > out.txt and get out.txt
- Enable XML logging and parse the listing out of the XML log:
http://winscp.net/eng/docs/logging_xml
_________________
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