Re: Error code 0 if get doesn't find any file
Still shows%ERRORLEVEL%
even when a file is found. Does not work.
Show us your batch file.
Still shows%ERRORLEVEL%
even when a file is found. Does not work.
Yes, if you execute a command, you can specifyoption failonnomatch on
and the command will return an error 1 instead of 0 if no wildcard file is found.
Example:"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\temp\winscp_output.log" /command "open YOUR_FTP_PROFILE" "option failonnomatch on" "put C:\temp\*.txt /" "exit"
%ERRORLEVEL%
even when a file is found. Does not work.
Is it possible to have an error when the directory is empty or no file has been downloaded ?
option failonnomatch on
and the command will return an error 1 instead of 0 if no wildcard file is found.
"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\temp\winscp_output.log" /command "open YOUR_FTP_PROFILE" "option failonnomatch on" "put C:\temp\*.txt /" "exit"
Problem : if no file has been found in /home/test/ using a filter like *, the return code is 0.
The script return an error (code 1) when I use (test.csv doesn't exist):"get -delete /home/test/test.csv d:\"
When specific file name is used, command fails when the file does not exist. When wildcard is used, command succeeds, without doing anything, if the wildcard does not match any file.
Is it possible to have an error when the directory is empty or no file has been downloaded ?
"get -delete /home/test/*.csv d:\"
"get -delete /home/test/test.csv d:\"