Skip to content

Bug: Windows environment variables don´t work with shortcuts #10914

Closed
@Activity3483

Description

@Activity3483

Description

If you use a shortcut with environment variables (I mean a path with "%username%", "%userprofile%", ...), the shortcut does not work in the files app anymore.

Steps To Reproduce

  1. right-click on a folder and select "create shortcut".
  2. right-click on the shortcut, select the info icon, select the "..." option from top-menu and choose the "shortcut" option.
  3. in the input field of "Destination" replace the part of the path "C:\Users<Username>" with ""C:\Users%username%".
  4. open the shortcut (double click, ...)

Steps to fix

I have no idea.
The path seems to be resolved incorrectly. Maybe write a "translator" for paths that puts them all in the same format.

Files Version

Version: 2.4.11.0 OS Version: 10.0.22621.963

Windows Version

Windows 11 22H2 22621.963

Relevant Assets/Logs

2023-01-03 17:38:54.8166|INFO|StartSTATask|An error occurred trying to start process '%userprofile%\Documents<abc>< abc > with working directory 'C:\WINDOWS\System32'. Das System kann die angegebene Datei nicht finden.
System.ComponentModel.Win32Exception (2): An error occurred trying to start process '%userprofile%\Documents<abc>< abc > with working directory 'C:\WINDOWS\System32'. Das System kann die angegebene Datei nicht finden.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Files.App.Shell.LaunchHelper.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Files.App.Shell.Win32API.<>c__DisplayClass3_0`1.<b__0>d.MoveNext()

i have replaced parts of the path with "abc"

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