My batch file for WinSCP only works with the hostkey but not with the privatekey

Advertisement

justinfraz
Joined:
Posts:
1
Location:
Melbourne

My batch file for WinSCP only works with the hostkey but not with the privatekey

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="D:\CoinFTP\Logs\Practifi_Logs\Log.txt" /ini=nul ^
/command ^
"open sftp://johnb@revex.com.au@ftp.hostedftp.com/ -privatekey=""D:\CoinFTP\KeyFiles\Practifi_PrivateKeyFile.ppk""" ^
"put -nopreservetime D:\CoinFTP\Data\Practifi\*" ^
"exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
cmd /c move /Y D:\CoinFTP\Data\Practifi\*.* D:\CoinFTP\Backup\Practifi_Backups
) else (
echo Error
)

exit /b %WINSCP_RESULT%

Reply with quote E-mail

Advertisement

Advertisement

You can post new topics in this forum