Upload to SFTP with Batch

Advertisement

AGG_MS
Joined:
Posts:
3
Location:
Dortmund

Upload to SFTP with Batch

Hello,
i tried several Times to generate a Batch Script to upload Files from Local C:\Users\%User%\Desktop\Test to an SFTP Server //vrspoftp/TEST/JAMA/OUT/ORDERS/.
I generate a fingerprint with WinSCP but it didn't work (sftp://vrspoftp;fingerprint=ssh-ed23418-AoEf9IR0MRCBMA1SS7ykBo9t-3zXrNYyiYkwffSUCds@183.94.1.89/vrspoftp/TEST/JAMA/OUT/ORDERS/)
To start the Upload I have the command line
put "C:\Users\%User%\Desktop\*.raw /vrspoftp/TEST/JAMA/OUT/ORDERS/"
What am I doing wrong?

With Greets from Germany AGG_MS

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Upload to SFTP with Batch

You didn't show us what are you doing, nor did you describe your problem. Please give us more details. Also please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

AGG_MS

Problem is solved

Hello, the path was not correct in its syntax. Therefore the script did not work properly. In the line with the command open I have the folder where I want to store the data in the SFTP server. I then had this in the line with the put command.
After I deleted it, the upload of the data works without any problems. Furthermore, I no longer log on to the SFTP server with my fingerprint, but with a password, username and IP.

Reply with quote

martin
Site Admin
martin avatar

Re: Problem is solved

So was anything wrong with the generated code? Or was the problem caused by your modification of the generated code?

Reply with quote

AGG_MS

The problem was not due to the code generated by WinSCP but to my modification in the command line. This is called after you have logged on to the SFTP server in the first line. My syntax was wrong in this line, I had no specifications from the generation of the WinSCP code.

Reply with quote

Advertisement

You can post new topics in this forum