您好
windows2019 使用winscp 將本機的目錄夾FTP到外部NAS,
若利用工作排程器自動執行(.bat)無法成功 ,
手動直接執行(.bat)成功,
請問哪裡設定錯誤或是哪裡出錯?
先謝謝您的幫忙!
set LOCAL_FILE=M:\data\
set REMOTE_DIR=/bak/
echo open ftp://%FTP_USER%:%FTP_PASSWORD%@%FTP_SERVER% > winscp_script.txt
echo lcd %LOCAL_FILE% >> winscp_script.txt
echo cd %REMOTE_DIR% >> winscp_script.txt
echo put -preservetime "%LOCAL_FILE%" >> winscp_script.txt
echo exit >> winscp_script.txt
%WINSCP_PATH% /script=winscp_script.txt
del winscp_script.txt
[解決]
winscp_script.txt 改成 c:\winscp\winscp_script.txt