Long Folder Names and failed defrag attempts

Howdy,

I've been seeing an issue with defraggler where I have a VERY LONG FOLDER NAME and some small PDFs in the folder, where Defraggler cannot defrag the files.

I recently had to manage some code in VBScript to handle long file names/paths by doing something similar to:

Set objfile = objFSO.CreateTextFile "//?/d:\some\long\file\path\that\is\very\deep\etc\and\so-on/you get the idea\some.log"




... where the long folder path exceeds the 260 characters for the standard APIs to connect to a folder because of the LFNs...  The prefix of "\\?\" enables the Long File Name APIs so VB can see files in the long file name API space.  I am assuming that whatever Defraggler is written is would need somethign similar to handle long file names/paths as well.

Is it possible this is happening in Defraggler as well? as I dont really see a reason that Defraggler is having a problem with the PDF files as they are not in use (every time I try to defragment them).

The version of defraggler doesn't seem to change the outcome as I have tried upgrading to the most recent version (v2.22.995)

HTH and thanks for any responses.

Steven M

I am just bumping this thread since it seem that no one responded and providing a link to help explain the issue and a workaround for Defraggler's coding issues for super long LFNs.

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd

The article explains how to enable the LFN APIS in code (getting the APIs to handle long folder/paths greater than 260 characters) as well as providing a registry edit that tells Windows to automatically enable the LFN APIs.

The following registry edit is listed in the link above and will auto-enable the LFN APIs in Windows 10 Build 1607 (as well as Server 2016) and above (making the coding of \\?\ for long directories/files unnecessary). I personally have tested it in Windows Server 2016 since there was no traction on this thread and wanted to defragment these files.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]

"LongPathsEnabled"=dword:00000001

No reboot is required, but I would assume that you'd need to close and reopen Defraggler for it to see the Filesystem API change.

HTH Someone.

Steven