Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

alexsts

Re: Local listing does not get written in log file

alexsts wrote:

Hi guys,
in my automation for getting list of the files from local directory ...
:(
Did not realized but there are similar question and answer from Martin. Not exactly what most of the users would want to hear but her it is: https://winscp.net/forum/viewtopic.php?p=45989#45989 :roll:
alexsts

Local listing does not get written in log file

Hi guys,
in my automation for getting list of the files from local directory I have following code(nothing new, standard WinSCP automation)
<code>
var path = FILEPATH;
var filename = FILENAME;
var logfilepath = filesys.GetSpecialFolder(2) + "\\" + filesys.GetTempName() + ".xml";
var exec;
exec = shell.Exec("\"" + WINSCP + "\" /log=\"" + logfilepath + "\"");
exec.StdIn.Write("option batch abort\n" + "open \"" + SESSION + "\"\n" + "lls \"" + path + "\"\n" + "exit\n");

// wait until the script finishes
while (exec.Status == 0)
{
WScript.Sleep(1000);
WScript.Echo(exec.StdOut.ReadAll());
}
</code>

and in echo(green colored) I can see that it did read local directory but when I am reading XML file - it is empty. Basically it means that write (in red) part is not working.
Any idea why and how to fix this?
Thanks