Reputation: 11
I have a job in Task Scheduler to move .jpg
files to another destination, but it flags some of the files with .filepart
, and what I notice is that it happens to files above 100kb. I looked around to make changes in the Task Scheduler Setting for files more than 100kb to be processed without attaching them with the .filepart
extensions but can't figure that out. Any suggestions are appreciated.
Below is the structure of my script:
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="E:\Path\To\Your\WinSCP.log" /ini=nul ^
/command ^
"open sftp://username:[email protected]/ -hostkey=""ssh-rsa 4096 hostkey_value="" -privatekey=""E:\Path\To\Your\Private-Key.ppk""" ^ "cd /your_directory/" ^
"lcd E:\" ^
"get 92578*.jpg "Your\Destination\"" -transferresumesupport=off ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
exit /b %WINSCP_RESULT%
I made changes to WinSCP setting for files above 100kb to be processed by increasing it to 200kb, and then ran the .bat
file manually and it worked but not in the Task Scheduler, and I'm not sure what setting I need to change.
Upvotes: 0
Views: 89
Reputation: 202534
I assume you use WinSCP script in Task Scheduler.
To disable transfer using temporary file name altogether, add -resumesupport=off
to your get
command, like:
"get -resumesupport=off 92578*.jpg C:\destination\path\" ^
You might have additional problems as formatting of your batch file is at the very least incostent and probably even wrong.
See https://winscp.net/eng/docs/faq_batch_file#newline_escaping
Upvotes: 0