Why use a batch file? Use PowerShell and the POSH-SSH module.
If you'd prefer something else try WinSftp
index.php
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi ,
I'm trying to get file from SFTP folder to my windows local directory .
I'm able to access SFTP via Winscp tools & move the file to my local using sftp & get command
However when i try to automate it using bat file , it is not working .Bat file runs & nothing happens.
Script in getcsvfile.bat file
echo @Ana Paula de Paula
open sftp://Username:pwd@publicIP/ -hostkey="ssh-rsa 2048 key="
pwd
cd /root/csvfiles
get *.csv c:\data
Can someone please help
A bat/cmd file runs Windows commands. The open/pwd/cd/get commands are not Windows commands, they are Winscp commands. Put those commands in a different file and call Winscp in your bat file passing that command sequence as an argument.
Hi, given that this post has been quiet for a while, this is a quick question and answer. Has your question been solved? If so, please mark it as an answer so that users with the same question can find and get help.
:)