0

here's my problem, I'm doing an internship in a company and I was asked to find a way to make a shortcut in a folder that is in my Pc but I want it to work in any other computer.

To do so, I want to replace the "C:/users/username/desktop/folder" for a "Variable".

Than in every computer or user that i want to use this shortcut, I just have to say that "variable" means "C:/users/username" or "D:/" or wherever i put the folder in.

Hackoo
  • 18,337
  • 3
  • 40
  • 70

2 Answers2

0

This should already be happening automatically when you create the shortcut. Meaning, the SpecialFolderDataBlock entry (and the known folder entry) will exist and its base location is a non-computer specific folder id + a offset into the main id list for the user/computer specific part. EnvironmentVariableDataBlock also exists when applicable.

Because the .lnk format is documented, you could create a shortcut that only contains a EnvironmentVariableDataBlock for example if you really wanted to...

Anders
  • 97,548
  • 12
  • 110
  • 164
0

Refer to How to create shortcut to Computer on the user's desktop


You can try this vbscript to create a shortcut to %userprofile% on the Desktop :

Just open your notepad or your notepad++ and save it as CreateShortcut.vbs


With CreateObject("WScript.Shell")
    With .CreateShortcut(.SpecialFolders("Desktop") & "\User Profile.lnk")
        .TargetPath = "%userprofile%"
        .Description = "Open User Profile Folder"
        .Save
    End  With
End  With
Hackoo
  • 18,337
  • 3
  • 40
  • 70
  • There is any way to send, i dont know like a folder or pdf to someone with that solution, but like, something on C:\teste to E:\teste2 ?! @Hackoo – José Carvalho Jun 27 '22 at 14:02