WinSCP Logging into the Wrong Website Folder

In a newer version of WinSCP, a setting was added to remember the last folder used. The setting usually works as expected, but there's been a few times where I'm dropped into an inaccessible folder with no apparent way to my website's files. Restarting WinSCP has fixed this type of issue in the past. This last week, however, restarting did not work. So it's time to investigate and share the findings.


When logging into WinSCP, I was recently greeted with the error message shown in Figure 1. Clicking OK brought me to an empty folder. There was a parent directory, but it contained dozens of unrecognizable folders which couldn't be opened. As mentioned earlier, restarting WinSCP usually fixes this issue. But, the same error message kept popping up.

Screenshot showing the WinSCP error
Figure 1. WinSCP Error

The error seems to be related to WinSCP remembering the last directory used. There's an empty folder just above where I normally go when accessing the server, but I almost never venture back that far. I say almost since curiosity has brought me there a time or two in the past, but it's been a while.


Getting things back to normal was as simple as

  1. Open WinSCP
  2. Select the profile causing the error
  3. Click Edit (see Figure 2)
  4. Under Environment, click Directories
  5. Remove the value entered for the remote directory (see Figure 3)
  6. Uncheck the "Remember last used directory" option to prevent future issues (see Figure 4)
  7. Save the updated profile
WinSCP screenshot showing the Edit button
Figure 2. Editing the Profile
WinSCP screenshot showing the remote directory value
Figure 3. Removing the Remote Directory Value
WinSCP screenshot showing how to disable the feature for remembering the last used directory
Figure 4. Disabling the Last Used Directory Feature

Note: the above directions are based on WinSCP 5.1.4.


Although having WinSCP remember the last folder used was handy on occasion, it wasn't as beneficial for me. When maintaining websites, I typically work in different areas of a website from day to day. So, turning off the feature isn't going to have much of an effect.

However, there's no reason to disable the "Remember last used directory" option if it proves useful to you. If WinSCP ever gets stuck in nowhere land, at least you know where to start looking.


There are currently no comments.

Leave a Comment