Opened 16 years ago

Last modified 16 years ago

#3231 closed Bug report

Fail to get desktop path

Reported by: vix123 Owned by:
Priority: normal Component: Other
Keywords: Cc: vix123, Tim Kosse
Component version: Operating system type:
Operating system version:


Trying to open the Desktop folder produces the message "Failed to get desktop path".

Although the path for my desktop and my documents have been altered, their locations are properly set in the registry and Filezilla can access the "my documents" folder without problems.

Filezilla should not try to get the desktop by following the %USERPROFILE%\Desktop route but it should get the path from the registry.

Change History (4)

comment:1 by Tim Kosse, 16 years ago

This is the responsible code:

if (SHGetFolderPath(0, CSIDL_DESKTOP, 0, SHGFP_TYPE_CURRENT, path) != S_OK)

wxMessageBox(_("Failed to get desktop path"));
return _T("/");


Looks like something isn't setup correctly on your system, Windows tells FZ that there is no Desktop.

comment:2 by vix123, 16 years ago

It's not a bug in my system because no other application (including non-MS like firefox) has a problem in accessing the desktop. The only difference is my registry settings as:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]

As I've said, Filezilla has no problem locating the "my documents" location which is altered in the same way (although in a different folder) as the Desktop.

Is it possible to use the SHGetSpecialFolderPath Function ( instead of the SHGetFolderPath ?

Added: I've noticed that you were using the SHGetSpecialFolderPath function but switched to SHGetFolderPath to solve NT compatibility issues. Bumper.

I created a folder called Desktop inside my %USERPROFILE% area and Filezilla could now locate the desktop without problems. However, it's still an issue because I really need to have the desktop located elsewhere for backup purposes.

comment:3 by vix123, 16 years ago



Shell Folders]

comment:4 by Tim Kosse, 16 years ago

I've committed a workaround to also try CSIDL_DESKTOPDIRECTORY in addition to CSIDL_DESKTOP.

Note: See TracTickets for help on using tickets.