Topic "Error getting name of current remote directory"

Author Message


I've seen this error before when trying to login using an interface session where the remote directory has not been set. But now it is set, and I'm seeing this error from an SSIS script task.

Here's the error output:
<?xml version="1.0" encoding="UTF-8"?>
-<session start="2013-04-06T21:50:52.674Z" name="login@ip_address" xmlns=""> -<failure> <message>Error getting name of current remote directory.</message> <message>Cannot get real path for '.'.</message> <message>Permission denied. Error code: 3 Error message from server (en): The data is invalid. , file: . Request code: 16</message> </failure> </session>

Here's the FTP Server log:
2062 Sft_server_no_virtual_folder_dir, "2062 Sft_server_no_virtual_folder_dir, "C:", Directory name: C:\, "Path 'C:\': is not a direcotory.""

Here's the WinSCP section of the script task:
Process winscp = new Process();
//winscp.StartInfo.FileName = "";
winscp.StartInfo.FileName = Dts.Variables["User::WinSCPcom"].Value.ToString();
winscp.StartInfo.Arguments = "/log=\"" + logname + "\"";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.CreateNoWindow = true;

// Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch abort");
winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("lcd " + Dts.Variables["User::DataFolder"].Value.ToString());
winscp.StandardInput.WriteLine("cd " + Dts.Variables["User::RemoteDir"].Value.ToString());
winscp.StandardInput.WriteLine("option transfer binary");
winscp.StandardInput.WriteLine("get " + Dts.Variables["User::SigDeletes"].Value.ToString());
winscp.StandardInput.WriteLine("get " + Dts.Variables["User::SigModules"].Value.ToString());

Here is the obfuscated value of the variable WinSCPopen: "open sftp://login:password@IP_address:port". I have confirmed the values by copying and pasting them into the GUI and successfully connecting.

As you can see, I tried adding a CD command before I realized that the error was thrown just after the open command is passed. The server shows a successful connection at first, then it realizes my session is "trying" to visit the C: drive.
[View user's profile]
Joined: 2013-04-06
Posts: 2
Another piece of information is that we had been using the default user folder for the project, then we moved the drop-off to a sub-directory off of D:. I don't understand: if the .ini file has the remote directory setting in D:, why would it try to connect to CConfused

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27083
Location: Prague, Czechia
It's your server that maps "." path to C:\. It has nothing to do with local configuration of WinSCP or anything, if that's what you mean by .INI file.

Anyway, why don't you use WinSCP .NET assembly?
[View user's profile]
Joined: 2013-04-06
Posts: 2
martin wrote:
It's your server that maps "." path to C:\. It has nothing to do with local configuration of WinSCP or anything, if that's what you mean by .INI file.

Anyway, why don't you use WinSCP .NET assembly?

The FTP server *is* set to look in another drive. So, perhaps there's some secondary setting that needs attention. Yes, I was referring to the WinSCP .ini file.

I want to use the .net assembly, but since we got the prototype to work, my boss wants to leave the architecture alone. We're stretched a bit for time right now and want to avoid more development hours.

Thanks Martin!

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License