Setting Working Directory Not Working as Expected
I have the following code to start the WinSCP process - this is being called in an SSIS C# script component:
Process winscp = new Process();
string logName = Dts.Variables["User::XMLLogLocation"].Value.ToString();
// Set the executable path and download directory
winscp.StartInfo.FileName = Dts.Variables["$Package::pWinSCPLocation"].Value.ToString();
winscp.StartInfo.WorkingDirectory = Dts.Variables["$Package::pDownloadDir"].Value.ToString();
// Set static execution options (these should not need to change)
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.CreateNoWindow = true;
winscp.StartInfo.Arguments = "/xmllog=\"" + logName + "\"";
Then the program runs a "synchronize local..." command to grab the appropriate files.
The issue I'm having is that the sync copies the new files to a directory that is different than what I've set in winscp.StartInfo.WorkingDirectory = Dts.Variables["$Package::pDownloadDir"].Value.ToString();
Any ideas on where/how the directory is changing? It goes 1 level deeper in the folder structure than I am specifying.
Process winscp = new Process();
string logName = Dts.Variables["User::XMLLogLocation"].Value.ToString();
// Set the executable path and download directory
winscp.StartInfo.FileName = Dts.Variables["$Package::pWinSCPLocation"].Value.ToString();
winscp.StartInfo.WorkingDirectory = Dts.Variables["$Package::pDownloadDir"].Value.ToString();
// Set static execution options (these should not need to change)
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.CreateNoWindow = true;
winscp.StartInfo.Arguments = "/xmllog=\"" + logName + "\"";
Then the program runs a "synchronize local..." command to grab the appropriate files.
The issue I'm having is that the sync copies the new files to a directory that is different than what I've set in winscp.StartInfo.WorkingDirectory = Dts.Variables["$Package::pDownloadDir"].Value.ToString();
Any ideas on where/how the directory is changing? It goes 1 level deeper in the folder structure than I am specifying.