[SOLVED] GetUserDir gives wrong location lazarus / 34-Windows ---------------------------------------------------------------------- Adrie · 2012-08-07 14:14 I have redirected the My Documents folder in WinXP to a network location (F:\). All my data are stored there and my program should find the data it neads in that location. When I go to My Documents in any program I end up in F:\. But when I call GetUserDir the function returns C:\Documents and Settings\Owner\My Documents which is empty because Windows uses the network location. Is there a workaround for this? Thanks in advance. ---------------------------------------------------------------------- typo · 2012-08-07 14:58 AFAIK GetUserDir asks Windows about the folder, so... ---------------------------------------------------------------------- Leledumbo · 2012-08-07 15:06 To be precise, it calls SHGetFolderPath with CSIDL_PROFILE argument. QuoteBut when I call GetUserDir the function returns C:\Documents and Settings\Owner\My DocumentsAre you sure? The function should return only until Owner, the My Documents part is not included. As in above URL, you could manually call the respective API with CSIDL_PERSONAL instead of CSIDL_PROFILE to get your My Documents folder (a bit confusing to read ) ---------------------------------------------------------------------- Adrie · 2012-08-08 09:25 Thanks. You put me on the right track. De unit windirs.pp contains a wrapper for the windows function. This works fine. The function GetWindowsSpecialDir(CSIDL_PERSONAL) gives me the right location (F:\).