Last active
April 11, 2022 13:55
-
-
Save mlabrkic/26e16bd48dd8e9a52cdc492f3c758ce0 to your computer and use it in GitHub Desktop.
"Multi Commander" script: create Symlink to nvim folder, http://multicommander.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MC_Mklink_nvim_folder_Symlink, F12 | |
------------------------------------------------------------ | |
/Windows has two command-line shells: the Command shell and PowerShell./ | |
Windows Command shell: | |
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands | |
An A-Z Index of Windows CMD commands: | |
https://ss64.com/nt/ | |
MKLINK: | |
https://ss64.com/nt/mklink.html | |
MKLINK [[/D] | [/H] | [/J]] LinkName Target | |
/D Create a Directory symbolic link. (default is file) | |
By default, only Administrators can create symbolic links. | |
------------------------------------------------------------ | |
// MultiCommander script: | |
// ------------------------------------------------------------ | |
// http://forum.multicommander.com/forum/index.php/topic,1345.msg4769.html#msg4769 | |
// To create Symlinks you must be admin. | |
// You can add "ASADMIN" and you will get a UAC dialog, or you can start MC as admin. | |
// LNKTYPE 3 = Symlink | |
// MC.Utils.CreateLink ASADMIN LNKTYPE=3 LNKSRC="<new source folder>" LNKTRG="<existing target folder>" | |
// <new source folder> Must not exists. | |
// <existing target folder> It exists. | |
// UAC dialog is shown and MCAdmin (Admin helper Process) is starts | |
// SymLink folder is created and points to existing target folder | |
// ------------------------------------------------------------ | |
// http://multicommander.com/docs/customcommands_list#mc.utils.createlink | |
// MC.Utils.CreateLink | |
// LNKTYPE 1 = Hardlink, 2 = Junction, 3 = Symlink, 4 = Shortcut | |
// Windows CMD command: | |
// MKLINK [[/D] LinkName Target | |
// /D Create a Directory symbolic link. (default is file) | |
// We want this: | |
// MKlink /D %USERPROFILE%\Documents\nvim\ %USERPROFILE%\AppData\Local\nvim1\ | |
// ------------------------------------------------------------ | |
@var $env = TranslateEnvString("%USERPROFILE%"); | |
@var $source_folder = $env ^ "Documents\\nvim\\"; | |
@var $target_folder = $env ^ "AppData\\Local\\nvim1\\"; | |
// LNKTYPE 3 = Symlink | |
MC.Utils.CreateLink ASADMIN LNKTYPE=3 LNKSRC={$source_folder} LNKTRG={$target_folder} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment