microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.5k stars 6.56k forks source link

PowerSymlink - Creates Symlinks from Context Menu ("mklink /D") #2527

Open camya opened 4 years ago

camya commented 4 years ago

Please add a PowerToy to create Symlinks from the Windows Explorer context menu.

For web projects, I often have to create symlinks (using mklink /D) from the command line. Having this feature in the Windows Explorer context menu will be a great time-saver.

The context menu should have two entries for this new PowerToy:

1) Only, if folder/file is selected - Context menu shows "PowerSymlink - link to ..."

2) Context menu shows "PowerSymlink - create new" (visible with or without selection)

The following command is used by me normally to created symlinks on the command-line. The context menu entry for symlinks will also help to make less mistakes while creating symlinks for sure.

mklink /D "C:\Users\username\Local Sites\__CHANGE-PROJECT-NAME__\app\public\wp-content\plugins\__CHANGE-PLUGIN-FOLDER-NAME__" "C:\Users\username\Local Sites - Shared Project Data\plugins\__CHANGE-PLUGIN-FOLDER-NAME__"

More ideas:

symlink_3

windows-shortcut

crutkas commented 3 years ago

for notes:

From @bedarren in issue https://github.com/microsoft/PowerToys/issues/11555

Yeah, i tried search with keyword Junction but not found. It's same but with J option. Example: mklink /J C:\LinkToFolder C:\Users\Name\OriginalFolder

SvenBudak commented 2 years ago

Yes please.. i dont want to download anymore 3rd party tools for that every time :)

R-N commented 2 years ago

+1 Honestly, I'm surprised no one has made this yet (at least I found none).

I have a quite different idea though. Drag a folder/file with right click, drop to the desired location for the link, then have the menu option "Create a symbolic link here" (or hard link too). Then it will ask for a file/folder name for the link, with the real name as the default. Way easier than having to specify a location, IMO. Also, ask for elevation if necessary.

Would be even nicer if the other way is also possible. Right click drag to move the file/folder elsewhere then create a link at the original location. This is my most common usage of symlinks, actually, to free up space in C:

miyukic commented 2 years ago

+1 Honestly, I'm surprised no one has made this yet (at least I found none).

I have a quite different idea though. Drag a folder/file with right click, drop to the desired location for the link, then have the menu option "Create a symbolic link here" (or hard link too). Then it will ask for a file/folder name for the link, with the real name as the default. Way easier than having to specify a location, IMO. Also, ask for elevation if necessary.

Would be even nicer if the other way is also possible. Right click drag to move the file/folder elsewhere then create a link at the original location. This is my most common usage of symlinks, actually, to free up space in C:

I think it is a wonderful idea.

I generally agree with it because it eliminates the need to copy the path to create a symbolic link.

The only downside is that you have to have multiple Explorer programs open at the same time when creating a symbolic link.

I wish it were as easy as copying and pasting a file/folder from the right-click context menu.

This would allow me to close one of the Explorers (e.g. the "To" side) at a time (no need to have two Explorers open at the same time), but has the disadvantage that the names of menu items, etc. would be more complicated.

SvenBudak commented 2 years ago

maybe it is even the easiest thing to do, if you can convert a folder link into a symlink by right clicking on it.

miyukic commented 2 years ago

If I have two locations open in explorer at the same time, I find it very easy and intuitive to create a symlink by drag and drop.

I think both methods should ultimately be employed, but it may be a matter of which one to create first.

Is anyone working on this issue (GUI to create symlinks)?

R-N commented 2 years ago

I wish it were as easy as copying and pasting a file/folder from the right-click context menu.

This would allow me to close one of the Explorers (e.g. the "To" side) at a time (no need to have two Explorers open at the same time), but has the disadvantage that the names of menu items, etc. would be more complicated.

Right. We can ctrl+c, right click, and paste as shortcut. Maybe we can have paste as symlink as well.

And as the counterpart, ctrl+x, right click, move here and create symlink (at original location).

maybe it is even the easiest thing to do, if you can convert a folder link into a symlink by right clicking on it.

Hey that's a great idea. We can just use shortcut menu windows already have, then convert the shortcut to a symlink. I think it should be simpler to implement than adding new menu in many places.

I found these on google:

spacenavy90 commented 2 years ago

+1 to this suggestion. Having used symlinks extensively on Linux its one of the biggest features I miss when using Windows. Hid them behind the expanded context menu if you have to, but please give us an easier GUI method of symlinking

TheChilliPL commented 1 year ago

There's a tool for Windows called LinkShellExtension and it works quite well for that

R-N commented 1 year ago

There's a tool for Windows called LinkShellExtension and it works quite well for that

Thank you! This is exactly what I wanted. You can right click drag and drop to make link. You can also right click, pick link source, then in destination folder, right click again, and drop as link. Very neat! It doesn't ask for a name, but you can just rename it afterwards.

knock2one commented 1 year ago

There's a tool for Windows called LinkShellExtension and it works quite well for that

i lvoe you

jamesford42 commented 8 months ago

Note my own riff on this (closed as duplicate right above this).

In situations where "paste shortcut" is shown in explorer context menu, show also "paste symbolic link" (ideally ordered right after it).

This approach would be both minimal effort to implement and a smooth UX.

They both actually fill a similar purpose, and its a workflow people understand: copy a folder/file to clipboard, paste a shortcut to it. And does not require any wizard popup forms.

To clarify, this would by default create symbolic links for everything at the top level which was copied: folder or file.

Should some power user actually want to create junctions .. well that's dangerous shit so just use the command line I say. But alternately, holding down shift when clicking "paste link" could perhaps do it after a "create junction?" confirm prompt.

GarThor commented 5 months ago

Thirding this.

I have a few projects I'm working on that need to manage different symbolic links (adding/removing/overwriting), so having a GUI to show and manage those symbolic links would be really handy... (sort of like the environment variable tool).

It would also be really useful to get context menus and visual indicators for explorer to know when something is a symlink (and what it points to).

Korb commented 1 month ago

@crutkas mentioned this issue on Apr 20, 2021 GUI wrapper for MKLink to create symbolic or hard link #10047

Formally speaking, symbolic link, hard link and directory junction are different entities, and this issue was created mentioning only the first, but not the second or third. However, as I understand it, further in this topic the fundamental implementation of all such file system capabilities in PowerToys is discussed? Should not only the creation of links be discussed here, but also the following questions:

  1. correct deletion of links (without deleting the original files and folders, as it happens in some cases at least in Windows 10)
  2. different types of icons for all types of links
  3. changing links (correcting the destination path for a previously created link)
  4. methods of interaction with the user (context menu of folders, files and free area in a folder, dragging with the cursor while holding down the modifier key).
  5. change the link type.
  6. automatic link correction in case of renaming or moving the destination folder / file.