I'm trying to use the latest file script, I have changed the paths etc but it never downloads a file. When checking, nodes is always = 0 to the latest file variable is never set. however the complete list of files is shown on the output.
I suppose you are trying to parse XML log, aren't you? Make sure you are using the latest version of WinSCP. Also, if you are enabling logging on command line, make sure the filename ends with .xml. If this does not help, you need to provide more details about what you are doing (and how).