.bat/script File Error on Windows Server 2019

Advertisement

caprarioa
Joined:
Posts:
2
Location:
Los Angeles

.bat/script File Error on Windows Server 2019

I have a windows Server 2019 with winscp installed. I have a sftp server I am trying to send a static file to from an internal folder. I have a script (.txt) file and a .bat file. I have searched many forums and no matter what I try I think my knowledge is too limited to correct my errors!

.bat file:
cd C:\Program Files (x86)\WinSCP winSCP.com /script=C:\Program Files (x86)\WinSCP\autoupload_script.txt

Script file:
open sftp://username:password@address.com/
cd E:\folder1\folder2\folder3
put E:\folder1\folder2\folder3\filetobetransfered1.csv
/*.*
exit

Reply with quote

Advertisement

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

Re: .bat/script File Error on Windows Server 2019

It should be two lines. and you also need to quote the paths with spaces:
cd "C:\Program Files (x86)\WinSCP"
winSCP.com /script="C:\Program Files (x86)\WinSCP\autoupload_script.txt"

Reply with quote

Advertisement

You can post new topics in this forum