Create symbolic link (MKLINK /D)
Moderators: Hacker, petermad, Stefan2, white
Create symbolic link (MKLINK /D)
In V8.52a one can create a shortcut by dragging with the right mouse button. A context menu item "Create Shortcut" appears. It would be great to have an additional menu item "Create Symbolic Link" which creates a symbolic link equal to the "MKLINK /D" windows command.
Such symbolic links are useful e.g. to include existing folders in the OneDrive folder.
Cheers,
Franz
Such symbolic links are useful e.g. to include existing folders in the OneDrive folder.
Cheers,
Franz
While there are requests to add native support for Symlinks/Junctions/Hardlinks to TC, you can use NTLinksMaker or NTFS Links which you can add to TC's button bar or starter menu.
Regards
Dalai
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Long-time TC users won't expect any features in drag menu because this menu is a Windows Explorer feature, and I believe that there is an Explorer extension that do what you want.
With TC, it is much more native to create links via copy/move/create shortcut/some other similar dialogs, and that is what mentioned tools do - you only need to assign a shortcut for them. E.g.: F5/F6 - copy, Ctrl+Shift+F5 - create shortcuts, Alt+F6 - create symlinks/junctions (via one of mentioned tools).
It is not bad to use plugins, it is bad to integrate into TC itself things that may be easilly integrated into TC via plugins.
With TC, it is much more native to create links via copy/move/create shortcut/some other similar dialogs, and that is what mentioned tools do - you only need to assign a shortcut for them. E.g.: F5/F6 - copy, Ctrl+Shift+F5 - create shortcuts, Alt+F6 - create symlinks/junctions (via one of mentioned tools).
It is not bad to use plugins, it is bad to integrate into TC itself things that may be easilly integrated into TC via plugins.
You dont even need plugins.
If you have a look on Petermad's Extended English Menus
http://totalcmd.net/authors/1223914.html
you will find em_commands which can be added as buttons or Main menu entries:
His packages are also contain all TC commands in Menus and lot of specific buttons.
If you have a look on Petermad's Extended English Menus
http://totalcmd.net/authors/1223914.html
you will find em_commands which can be added as buttons or Main menu entries:
Code: Select all
[em_ext_symlinkd]
cmd=*%COMSPEC% /K
param=if exist %P%N\* (mklink /D %T%N %P%N) else (echo The cursor must be on a FOLDER)
path=%SYSTEMDRIVE%\
menu=Make Symlink in Opposite Panel to FOLDER Under Cursor
button=%COMMANDER_EXE%,12
[em_ext_symlink]
cmd=*%COMSPEC% /K
param=if not exist %P%N\* (mklink %T%N %P%N) else (echo The cursor must be on a FILE)
path=%SYSTEMDRIVE%\
menu=Make Symlink in Opposite Panel to FILE Under Cursor
button=%COMMANDER_EXE%,12
[em_ext_hardlink]
cmd=%COMSPEC% /K
param=if not exist %P%N\* (mklink /H %T%N %P%N) else (echo The cursor must be on a FILE)
path=%SYSTEMDRIVE%\
menu=Make Hardlink in Opposite Panel to FILE Under Cursor (Only on Same Drive)
button=%COMMANDER_EXE%,12
Thats right but I mostly need it for single directories.MVV wrote:These commands aren't useful when you need to create links for many files...
For complex cases I have Link Shell Extension (LSE)
http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html
Mentioned by me above.Horst.Epp wrote:For complex cases I have Link Shell Extension (LSE)
http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html

Since I don't work in Explorer at all, it is much faster and convenient for me to use NTLinks Maker (it was made as NTFS Links analog to fulfil my needs).
You don't need running TC as Administrator for that em_command to work.MVV wrote:Since it works for you, it seems that you're always running TC as administrator, which is not a safe way of using it. It is more safe to use non-elevated TC and elevate only operations that require it (like symlink creation or writing to system folders).
There comes an UAC prompt if enhanced rights are required.
Re: Create symbolic link (MKLINK /D)
I see that this is a pretty old post, but just in case anyone finds this, and wants a better solution, add this to the usercmd.ini file:
After that, I would suggest adding a new entry to the start menu, and assigning the Ctrl+Alt+F5 hotkey to the preferred version of the action.
Code: Select all
[em_ext_junction]
cmd=*%COMSPEC% /C
param=@for /f "usebackq tokens=*" %%i in ("%F") do @( if exist "%P%%~i\" ( mklink /J "%T%%~i" "%P%%~i" ) else ( mklink "%T%%~i" "%P%%~i" ) )
menu=Make directory junction or file symlink in the opposite panel for selected files
button=%COMMANDER_PATH%\WCMICON2.DLL,65
iconic=1
[em_ext_symlink]
cmd=*%COMSPEC% /C
param=@for /f "usebackq tokens=*" %%i in ("%F") do @( if exist "%P%%~i\" ( mklink /D "%T%%~i" "%P%%~i" ) else ( mklink "%T%%~i" "%P%%~i" ) )
menu=Make directory or file symlink in the opposite panel for selected files
button=%COMMANDER_PATH%\WCMICON2.DLL,65
iconic=1
[em_ext_junction_hard]
cmd=*%COMSPEC% /C
param=@for /f "usebackq tokens=*" %%i in ("%F") do @( if exist "%P%%~i\" ( mklink /J "%T%%~i" "%P%%~i" ) else ( mklink /H "%T%%~i" "%P%%~i" ) )
menu=Make directory junction or file hardlink in the opposite panel for selected files
button=%COMMANDER_PATH%\WCMICON2.DLL,65
iconic=1
[em_ext_symlink_hard]
cmd=*%COMSPEC% /C
param=@for /f "usebackq tokens=*" %%i in ("%F") do @( if exist "%P%%~i\" ( mklink /D "%T%%~i" "%P%%~i" ) else ( mklink /H "%T%%~i" "%P%%~i" ) )
menu=Make directory symlink or file hardlink in the opposite panel for selected files
button=%COMMANDER_PATH%\WCMICON2.DLL,65
iconic=1
Re: Create symbolic link (MKLINK /D)
Using the NTLinksMaker add-on makes this much simpler,Speeder wrote: ↑2023-09-23, 10:05 UTC I see that this is a pretty old post, but just in case anyone finds this, and wants a better solution, add this to the usercmd.ini file:
...
After that, I would suggest adding a new entry to the start menu, and assigning the Ctrl+Alt+F5 hotkey to the preferred version of the action.
as it only needs one button for all options.
Windows 11 Home x64 Version 23H2 (OS Build 22631.2715)
TC 11.02 x64 / x86
Everything 1.5.0.1361a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.59
QAP 11.6.2.3.1 x64
TC 11.02 x64 / x86
Everything 1.5.0.1361a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.59
QAP 11.6.2.3.1 x64
Re: Create symbolic link (MKLINK /D)
Also these user-commands don't support Unicode names.