Put -> File Path? (Batch)

Advertisement

dersebi
Joined:
Posts:
2

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

withtmppath.JPG

withouttmppath.JPG

Reply with quote

Advertisement

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

Reply with quote

dersebi
Joined:
Posts:
2

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>

Reply with quote

Advertisement

You can post new topics in this forum