If you want to use UTF-8 in a batch file, you need to use
See Echo UTF-8 characters in Windows batch
chcp 65001
See Echo UTF-8 characters in Windows batch
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
chcp 65001
/script="C:\Users\81803\デスクトップ\rad\conf\sftp_recieve.conf"
/script="%~dp0rad\conf\sftp_recieve.conf"
%~dp0
is the working directory on where the batch file was executed.
WinSCP.com
but it was still the same result. Nothing happening and the console closes right away. I also tried using it with and without /console
"C:\Users\81803\AppData\Local\Programs\WinSCP\WinSCP.com" /console /script="C:\Users\81803\デスクトップ\rad\conf\sftp_recieve.conf" /ini=nul /log="C:\Users\81803\デスクトップ\rad\log\winscplog.log" >> %BATLOGFILE% 2>&1
/script="C:\Users\81803\デスクトップ\rad\conf\sftp_recieve.conf"
out\SYOHINMT\<time executed>
and copy all the files to \ftp_recieve\
SET BATLOGFILE="%~dp0log\sftp_recieve.log"
SET BATLOGTEMP="%~dp0log\sftp_recieve_tmp.log"
SET yyyyMMdd=%date:/=%
SET hhmmss=%time: =0%
SET hhmmss=%hhmmss:~0,2%%hhmmss:~3,2%%hhmmss:~6,2%
mkdir "%~dp0out\SYOHINMT\%yyyyMMdd%_%hhmmss%"
cd "%~dp0out\SYOHINMT\%yyyyMMdd%_%hhmmss%"
"C:\Users\81803\AppData\Local\Programs\WinSCP\WinSCP.exe" /console /script="C:\Users\81803\デスクトップ\rad\conf\sftp_recieve.conf" /ini=nul /log="C:\Users\81803\デスクトップ\rad\log\winscplog.log" >> %BATLOGFILE% 2>&1
for /f "delims=" %%a in (%BATLOGTEMP%) do (
echo %%a >> %BATLOGFILE% 2>&1
echo "%%a" | find "%200 COMPLETED.%" >NUL
if not ERRORLEVEL 1 set /a COMPCOUNT=COMPCOUNT+1
)
copy .\* ..\..\..\ftp_recieve\ >> %BATLOGFILE% 2>&1
EXIT
sftp_recieve.conf
script:
option batch on
open sftp://xxxx@xxxx.amazonaws.com:22 -privatekey="C:xx\xxx\keys\xxxx.ppk" -hostkey="ssh-rsa 2048 xxxxxxxxxxx"
get -resume ./*
close
exit
"C:\Users\81803\AppData\Local\Programs\WinSCP\WinSCP.exe" /console /script="C:\Users\81803\デスクトップ\rad\conf\sftp_recieve.conf" /ini=nul /log="C:\Users\81803\デスクトップ\rad\log\winscplog.log" >> %BATLOGFILE% 2>&1