Multi Commander > Support and Feedback
MC.Utils.CreateLink doesn't work?
khaoos:
Hello, Mathias. I can't figure out what I am doing wrong with a custom command. I am trying to make a MC.Utils.CreateLink to create a symlink. I have even tried the most easiest case, for example MC.Utils.CreateLink LNKSRC="D:\1.txt" LNKTRG="D:\2.txt" LNKTYPE=3. Nothing happens. I will be appreciate for any help.
Version of MC is 4.6.2 (build 1804) 64bit
Mathias (Author):
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.
khaoos:
I am already an admin and mc is started with admin privileges, and I've tried an ASADMIN option too. Nothing works. I only see a confirmation dialog when I set an appropriate option in command (Display confirmation dialog...). Interesting, I don't see a confirmation dialog when I purposely execute a wrong command, for example MC.Utils.CreateLink1, but I see one when give a wrong argument to a proper command, for example ASADMIN1. So I conclude the command is correct. Are options' names for this command correct in documentation? Could you give me a file with a properly working multi-script CreateLink command, so I can try it on my machine?
Jungle:
--- Code: ---if ( GetSourcePath() == GetTargetPath() ) return;
@var $sel_files = GetSourceSelectedPaths();
@var $src_file;
@var $lnk_file;
@var $i = 0;
for ( $i = 0; $i < arrayCount( $sel_files ); $i++ )
{
$src_file = $sel_files[ $i ];
$lnk_file = GetTargetPath() + PathGetNamePart( $src_file );
MC.Utils.CreateLink LNKTYPE=1 LNKTRG="{$src_file}" LNKSRC="{$lnk_file}";
}
--- End code ---
Mathias (Author):
--- Quote from: khaoos on January 20, 2015, 13:21:46 ---I am already an admin and mc is started with admin privileges, and I've tried an ASADMIN option too. Nothing works. I only see a confirmation dialog when I set an appropriate option in command (Display confirmation dialog...). Interesting, I don't see a confirmation dialog when I purposely execute a wrong command, for example MC.Utils.CreateLink1, but I see one when give a wrong argument to a proper command, for example ASADMIN1. So I conclude the command is correct. Are options' names for this command correct in documentation? Could you give me a file with a properly working multi-script CreateLink command, so I can try it on my machine?
--- End quote ---
Works for me. Sure you have not mixed up SRC and TARGET ?
MC.Utils.CreateLink LNKSRC="R:\1.txt" LNKTRG="R:\2.txt" LNKTYPE=3 ASADMIN
1.txt Must not exists..
2.txt exists.
UAC dialog is shown and MCAdmin (Admin helper Process) is starts
SymLink 1.txt is created and points to 2.txt
(Also if you are connected to work domain symlinks can be disabled by admin. and you must have permission for it. and there is a max number of symlinks you can have in a folder..)
Navigation
[0] Message Index
[#] Next page
Go to full version