I am using a c# .net service and calling out to winscp in a process and i am having hidden files written to the C drive for some reason and don't know how to get rid of them. I only noticed these when i showed hidden files. Is there an option command or something that i can use to prevent creating of files?
Version 4.3.9 build 1817 i only have been using this one version.
I am using SFTP protocol
In the GUI preferences under storage i have it pointed to an F drive location.
Here is my script from my code.
// Run hidden WinSCP process
using (Process winscp = new Process())
{
winscp.StartInfo.FileName = "winscp.com";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.CreateNoWindow = true;
if (winscp.Start())
{
const string quote = "\"";
// Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch abort");
winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open moveFiles@moveFiles");
winscp.StandardInput.WriteLine("put -delete " + quote + file + quote + " " + quote + destfile + quote);
winscp.StandardInput.Close();
// Collect all output (not used in this example)
string output = winscp.StandardOutput.ReadToEnd();
WriteToErrorLog(output + ArchiveDirectory + DirectoryDateTimeStamp, ErrorLog, LogDirectory);
// Wait until WinSCP finishes
if (!winscp.Has_Exited)
winscp.WaitForExit();
}
else
{
WriteToErrorLog("Move to Linux Destination Error " + SourceDirectory, ErrorLog, LogDirectory);
}
// Success (0) or error?
if (winscp.ExitCode != 0)
{
WriteToErrorLog("Move to Linux Destination Error " + SourceDirectory, ErrorLog, LogDirectory);
sendEmailError("Move to Linux Destination Error ", LogDirectory);
}
}