Errorlevel 0 but no files downloaded!

Advertisement

sumdumgai
Joined:
Posts:
8

Errorlevel 0 but no files downloaded!

My remote server occasionally has no files to download but I can't find any way to trap that condition. Errorlevel for WinSCP returned is zero in my .bat file. I've tried Batch Abort with no luck. I've searched FAQ's. Is there a simple way to check if files are available for download or have been downloaded? I don't have any JAVA scripting experience. I am using WINSCP batch scripting commands. Thanks for your help.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Errorlevel 0 but no files downloaded!

If you are using a mask (wildcard) to download files, then absence of files is not an error. You may investigate XML log after the script finished to find if any files were downloaded. Use this script for inspiration. Just when looking for files replace "w:file/w:filename" with "w:download/w:filename".

Reply with quote

sumdumgai

Whoa. That's a lot to digest. But I'll study this a bit to try and understand it. Like I said, my scripting experience is very limited. Thanks for your advice.

Reply with quote

sumdumgai

Can't figure this out. Does WinSCP create the log file if I add /log option, or do I have to create one (how)? If I need to run a script to create and read the log file, I'm in trouble because I just don't have any JAVA scripting experience. I just want to know if any files were downloaded. Thanks.

Reply with quote

martin
Site Admin
martin avatar

Log file is created if you use the /log option.

You need to use some programming language to interpret the log.

Reply with quote

Advertisement

You can post new topics in this forum