Post a reply

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

dersebi

Re: Put -> File Path? (Batch)

martin wrote:

The ^ has to be the very last character on batch file line for it to work correctly to escape the new line. No spaces after it are allowed.

Hey Martin,

just forget it .

There was a mistake in my code.

The filepath has to be with 1 ", I used 2.

Thanks for help. (#close)

Regards
Sebi

Sorry, delete the Guest Post.
I forgot to log in.</s>
Guest

Re: Put -> File Path? (Batch)

martin wrote:

The ^ has to be the very last character on batch file line for it to work correctly to escape the new line. No spaces after it are allowed.

Hey Martin,

i changed the script.
Still the same problem.
The script stops and if I enter "Exit" I get the error.

How can I set the path where the files are uploaded from?

Regards
Sebi
martin

Re: Put -> File Path? (Batch)

The ^ has to be the very last character on batch file line for it to work correctly to escape the new line. No spaces after it are allowed.
See https://winscp.net/eng/docs/faq_batch_file
dersebi

Put -> File Path? (Batch)

Hello,

I need a script (batch) which uploads files from a local windows machine (2008 R2) to a FTP-Server.

"C:\Program Files (x86)\WinSCP\winscp.com" /command ^
"open sftp://ID:PW@SERVER.COM" ^
"put ""*.data""" ^
"exit"

I also tried it with a temppath, but that also didn't worked.

set TMPPATH=C:\tmp\temppath
"C:\Program Files (x86)\WinSCP\winscp.com" /command ^
"open sftp://ID:PW@SERVER.COM" ^
"put ""*.data"" ""TMPPATH""" ^
"exit"

Everytime the script can connect to the server but then it stops.
I can enter exit and then I get the error in the attached screenshots.

Do I have to enter the path where the files which I want to upload in the skript? If yes where or how can I enter the path?

Anyone can help me?

Thanks & Regards