Multi Commander > Script

run cmd command in script

(1/1)

log:
hi,
please, i will run this command in the script of multicommander:
mklink /D "D:\Cloud\Folder" "C:\Labo\MyFolder\"
it run correctly in cmd;
but i will run in in script.
thank you.

mlabrkic:
I'm sorry,

I deleted the web links...
maybe I'll write something later.

AlanJB:
Please don't post links to remotely hosted scripts - many of us will NOT follow unknown links.

Instead, post your scripts here in code blocks.

Thanks

mlabrkic:
Hi,
/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.


--- Code: ---// ------------------------------------------------------------
// 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're trying this:
// mklink /D "D:\Cloud\Folder" "C:\Labo\MyFolder\"

// ------------------------------------------------------------

@var $source_folder = "D:\\Cloud\\Folder\\";

// @var $env = TranslateEnvString("%USERPROFILE%");
// @var $target_folder = $env ^ "Documents\\MyFolder\\";
@var $target_folder = "C:\\Labo\\MyFolder\\";

// LNKTYPE 3 = Symlink
MC.Utils.CreateLink ASADMIN LNKTYPE=3 LNKSRC={$source_folder} LNKTRG={$target_folder}


--- End code ---

Navigation

[0] Message Index

Go to full version