Topic "Query with a simple get script"

Author Message
Chris_Tarris

Guest


Hi there, I am having trouble getting a simple script to run.

Running WinSCP version 5.5.0 (Build 3839) Commander interface on Windows 7. Transfer protocol is SFTP, trying to get a script to run manually.

My .bat file is:

Code:
@echo off
winscp.exe /console /script=script.txt


My script.txt is in the same directory as the .bat:

Code:
option batch abort
option confirm off
open sftp://user:pass@00.000.000.00
get ""/Email Attachments/File_1.csv"" .\
exit


(I have wrapped the remote path in double quotes due to the space in the folder name.)

When I run the .bat file, the file is not retrieved - nor does anything show up in the log window.

I'm wondering if I've missed a step somewhere.

Thank you in advance for any help you can provide!

Kind regards
Chris
Advertisements
Chris_Tarris
[View user's profile]

Joined: 2013-12-30
Posts: 2
[I didn't register before posting. Adding this reply to receive email notifications. Thanks.]
Chris_Tarris
[View user's profile]

Joined: 2013-12-30
Posts: 2
I read a few more forum posts and realised I needed to run the script in the same folder as the .exe. Sorry! Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Also:
1) You should better use winscp.com to avoid additional console window popup for winscp.exe.
2) You should use only single double quotes: get "/Email Attachments/File_1.csv" .\
_________________
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