Skip to content

Bug: Creating shortcuts in a library directory does not work #10726

@marcus-k

Description

@marcus-k

Description

As the title suggests, when in a library folder such as Documents, Music, Pictures, or Videos, shortcuts cannot be created of files nor folders.

The error message from the debug.log when trying to do so states:

2022-12-15 13:18:15.5286|WARN|CreateOrUpdateLinkAsync|The system cannot find the path specified. (0x80070003)
	System.IO.DirectoryNotFoundException: The system cannot find the path specified. (0x80070003)
   at System.Runtime.InteropServices.ComTypes.IPersistFile.Save(String pszFileName, Boolean fRemember)
   at Vanara.Windows.Shell.ShellLink.SaveAs(String linkFile)
   at Files.App.Helpers.FileOperationsHelpers.CreateOrUpdateLinkAsync(String linkSavePath, String targetPath, String arguments, String workingDirectory, Boolean runAsAdmin)

Steps To Reproduce

  1. Navigate to a library folder via the left side menu.
  2. Create a shortcut of the desired file or folder.
  3. Nothing happens

Steps to fix

I believe this may be due to the difference in the displayed path when in a library folder. That is, instead of the regular path one might expect, the path is:

C:\Users\Username\AppData\Roaming\Microsoft\Windows\Libraries\Documents.library-ms

My guess is that this pathname difference is in conflict with the current way of creating shortcuts and it cannot resolve the path to create the desired shortcut. Correctly resolving the path might fix the issue.

Files Version

Version: 2.4.1.0 OS Version: 10.0.19044.2364

Windows Version

Windows 10 21H2 19044.2364

Relevant Assets/Logs

debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions