2

I am using DVC for a project that I'm working on, for tracking and running a data processing pipeline that needs to run on Windows. DVC uses symbolic links as a way of connecting files' original paths to the copies in the cache.
However, on Windows 11, in the Explorer window these symbolic links appear not as regular files but instead as a weird file of type ".symlink" even though the filename does not actually contain this extension:

See here:
See here.

This prevents me from being able to open these files normally.

As a result, thumbnails don't show up for images, and when clicked on, the file does not actually open with the right application for the real extension, but an application picking window for the .symlink extension shows up instead.

How can I make Windows treat these symbolic links as regular files, at least for interaction through Windows Explorer (e.g. clicking on them)?

Thanks in advance for the help.

Markus Meyer
  • 1,370
  • 5
  • 11
  • 17
cgokmen
  • 73
  • 5
  • 1
    Can you open one of these symlink files in Notepad? https://dvc.org/doc/user-guide/large-dataset-optimization suggests that symbolic links in DVC ate not "editable" and so are not what you are after. I suspect what you want is hardlinks but they have their own requirements. – Mokubai Aug 11 '22 at 07:54
  • I see what you are talking about cgokmen (in a W11 VM). This is horrible code. @Mokubai , for instance, if I create a .TXT document in my documents folder and symlink it my desktop, windows treats it differently (and it shouldn't). If I double click the actual source for the TXT file, it opens with the correct handler (in my case NOTEPAD).. if I double click the symlink (which SHOULD be no different), windows pops up a dialog to choose how I want to open it. Windows KNOWS it is related as it has "keep using this app" pointed at notepad. I am too lazy to trace down the registry connection. – Señor CMasMas Aug 11 '22 at 17:41
  • 1
    I am too lazy because I hate W11 explorer. – Señor CMasMas Aug 11 '22 at 17:43
  • @SeñorCMasMas I'd just let [NirSoft File Types Manager](https://www.nirsoft.net/utils/file_types_manager.html) figure that out :) – MiG Aug 11 '22 at 19:35
  • @MiG , this is something the W11 explorer is dealing with internally/under the hood. An HKCR key exists for ".symlink" (even though that isn't really an extension) and it isn't really hooked up to anything. It isn't "on the list" for FileTypesMan. Now that I know that other key path, there isn't much more it can do than I can but I tried it anyway. :^P .. NADA. You can't say I didn't try your fix though! :) – Señor CMasMas Aug 11 '22 at 20:34
  • I believe there is probably something in there to control this but I don't want to waste hours in ProcMon figuring it out (again, WE HATES W11 explorer). – Señor CMasMas Aug 11 '22 at 20:35
  • @SeñorCMasMas Wasn't referring to the symlink mechanism itself but the part where it goes to the right handler - it's gotten a lot more complicated since the XP days :) – MiG Aug 11 '22 at 21:03
  • Manually-created symlinks do work for me in explorer (they start the associated program, but do not create thumbnails), but maybe I fixed that myself? Try out pwsh: `New-Item -ItemType SymbolicLink -Path "C:\symlinks\image.jpg" -Target "C:\images\image.jpg"`. I know some software like git can create legacy(?) symlinks that don't work very well – Cpt.Whale Aug 16 '22 at 17:09

1 Answers1

1

This problem exists since Windows 7, when Windows 7 Update KB3039066 broke symbolic links in Windows Explorer and all programs that use the services provided by the Windows shell.

The problem was asked on our site in the posts :

In both posts the only workaround that was offered was to replace the symlinks by another type (hard link, directory symbolic link or Directory Junction).

If you can recreate the symlinks created by DVC using a stronger type, as above, this will be a solution. Otherwise, there might not exist a simple solution that does not pass through the Open With context-menu.

Some third-party File Explorer Alternatives might treat these files differently, but I can't recommend any of them.

harrymc
  • 455,459
  • 31
  • 526
  • 924