Topic "Log file not generating."

Author Message
wmb853

Guest


I am working on an issue and need to generate a log file. I am running WinSCP from a bat file below:

c:\WinSCP\WinSCP3.exe /console /script="c:\EMT\AutoFTP.txt" /log="C:\EMT\winscp.log"


No log file ever gets generated. Thanks.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Can you try it with the latest version?
_________________
Martin Prikryl
Guest




prikryl wrote:
Can you try it with the latest version?



I just upgraded to the latest version. I never see the winscp.log file get created in the C:\EMT folder or anywhere else.

Thanks!
Bill
Guest




prikryl wrote:
Can you try it with the latest version?


I should also clarify that the FTP upload is working correctly. I just don't get a log file.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
_________________
Martin Prikryl
Alex2011

Guest


I have the same problem...
Have you got a soluttion
Guest




Alex2011 wrote:
I have the same problem...
Have you got a solution


That's ok now !
tdguitar

Guest


I have a function with creating log xml file like below. It run well on local machine, but when I publish it to be used as client-server, it can not create a log file. Please help me to check it.
Code:

const string logname = "log.xml";
Process winscp = new Process();
winscp.StartInfo.FileName = "C:\\Program Files\\WinSCP\\winscp.com";
winscp.StartInfo.Arguments = "/log=C:\\"" + logname + "\"";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.CreateNoWindow = true;
winscp.Start();
winscp.StandardInput.WriteLine("option batch abort");
winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open mysession");
winscp.StandardInput.WriteLine("ls");
winscp.StandardInput.Close();

string output = winscp.StandardOutput.ReadToEnd();
 
winscp.WaitForExit();
XPathDocument log = new XPathDocument(logname);
XmlNamespaceManager ns = new XmlNamespaceManager(new NameTable());
ns.AddNamespace("w", "http://winscp.net/schema/session/1.0");
XPathNavigator nav = log.CreateNavigator();
XPathNodeIterator files = nav.Select("//w:file", ns);
Console.WriteLine(string.Format("There are {0} files and subdirectories:", files.Count));
    foreach (XPathNavigator file in files)
    {
        Console.WriteLine(file.SelectSingleNode("w:filename/@value", ns).Value);
    }
tdguitar

Guest


tdguitar wrote:
I have a function with creating log xml file like below. It run well on local machine, but when I publish it to be used as client-server, it can not create a log file. Please help me to check it.
Code:

const string logname = "log.xml";
Process winscp = new Process();
winscp.StartInfo.FileName = "C:\\Program Files\\WinSCP\\winscp.com";
winscp.StartInfo.Arguments = "/log=C:\\"" + logname + "\"";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.CreateNoWindow = true;
winscp.Start();
winscp.StandardInput.WriteLine("option batch abort");
winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open mysession");
winscp.StandardInput.WriteLine("ls");
winscp.StandardInput.Close();

string output = winscp.StandardOutput.ReadToEnd();
 
winscp.WaitForExit();
XPathDocument log = new XPathDocument(logname);
XmlNamespaceManager ns = new XmlNamespaceManager(new NameTable());
ns.AddNamespace("w", "http://winscp.net/schema/session/1.0");
XPathNavigator nav = log.CreateNavigator();
XPathNodeIterator files = nav.Select("//w:file", ns);
Console.WriteLine(string.Format("There are {0} files and subdirectories:", files.Count));
    foreach (XPathNavigator file in files)
    {
        Console.WriteLine(file.SelectSingleNode("w:filename/@value", ns).Value);
    }


No one answer me the problem Sad
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
tdguitar wrote:
I have a function with creating log xml file like below. It run well on local machine, but when I publish it to be used as client-server, it can not create a log file. Please help me to check it.

Make sure the account that runs the script has write access to C:\
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License