Author Topic: How to create a shortcut?  (Read 20534 times)

andrewkirk

  • Newbie
  • *
  • Posts: 7
    • View Profile
How to create a shortcut?
« on: May 31, 2016, 08:22:03 »
Hello

I have just installed MC on my PC and the portable version on a USB stick and I am trying to create a command that creates a shortcut.

However the Tools > File Links menu option that is in the non-Portable version is not there in the portable version. Is that deliberate*? I sometimes need to work on a PC on which I have a folder to which I have read-write access, but I cannot install programs on the computer. So I was hoping to use MC Portable to organise my folder structure. But shortcuts are a key part of how I make the hierarchy easy to navigate, so I'm hoping that MC portable can still do them.

Since the Create Link menu option was not available in MC portable I tried setting a Custom Command in the portable version to create a link in the same directory, next to the link target (so that the shortcut could then be moved to where it was needed), using

MC.Utils.CreateLink LNKSRC="${targetpath}${sourcefocusname} -  shortcut"   LNKTRG="${focusfilepath}"   LNKTYPE=4
 
but this did not create any link.

Any help would be greatly appreciated!

Thank you

* I notice that Multi Rename is also not in the menu for the portable version. Is that also deliberate?



AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: How to create a shortcut?
« Reply #1 on: May 31, 2016, 11:56:51 »
I use only the portable version and I have both
 Extensions -> Multi-Rename and
 Tools -> File Links

AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: How to create a shortcut?
« Reply #2 on: May 31, 2016, 12:06:31 »
To create your shortcut, try:

@var $FileName = GetSourceFocusPath();
@var $LinkName = $FileName + ".lnk";
MC.Utils.CreateLink LNKSRC="{$LinkName}" LNKTRG="{$FileName}" LNKTYPE=4

andrewkirk

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: How to create a shortcut?
« Reply #3 on: May 31, 2016, 13:28:22 »
Thank you Alan for both your posts.

I hope somebody will be able to tell me why my portable version does not have Extensions > Multi-Rename or Tools > File Links

Both my USB (Portable) and my hard drive (non-portable) versions are v6.2, build 2147. I am running Windows 7 on an Intel PC.

I tried your code, first as a Custom Command and later as Multi-Script but it refuses to do anything when I call it by the assigned HotKey Ctrl+Shift+Alt+L. I tried assigning a different HotKey Ctrl+Alt+L but that seemed to pull up some different command for finding files, even though it did not say there was a conflict when I assigned the HotKey.

AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: How to create a shortcut?
« Reply #4 on: May 31, 2016, 19:11:50 »
Hi Andrew (I assume  ;)).

Sorry - should have said it was a Multi Script (Custom Commands can only be 1-line commands).

Have you tried running it through the Multi Script Debugger (1st entry under the Help menu)?  If not, before you do, make sure Multi Commander has focus on a file you want to create a shortcut for...

If you are suffering from customized keyboard (Hotkey) conflicts, try assigning your Multi Script to an obscure key combination that cannot possibly be assigned already.  Say, Ctrl+Shift+Alt F4, for example.

FWIW, I have a User-Defined menu for testing commands:  I attach the new command to the menu and test it works before I assign a Hotkey to it.

As for your missing menu entries, as a WAG, under Configuration -> Manage Plugins and Extensions, with Extension type: set to "Application Extensions", are "File Utils" and "Multi Rename" both checked?


Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: How to create a shortcut?
« Reply #5 on: May 31, 2016, 22:32:05 »
Thank you Alan for both your posts.

I hope somebody will be able to tell me why my portable version does not have Extensions > Multi-Rename or Tools > File Links

Both my USB (Portable) and my hard drive (non-portable) versions are v6.2, build 2147. I am running Windows 7 on an Intel PC.

Did you do a refresh download of portable version or did you upgrade..  If you upgrade then maybe some files did not get replaced.
Check "Manage Plugins and Extensions" and see it listed there.  and check so that the interface column is the same for all .
and check so you actually have the file on disk.   MultiRename extension is located in MCUtils.dll
Of if you download then maybe you did not unpack it correct and that extension is missing.. or you might have disabled in the "Manage Plugins and Extensions"
« Last Edit: June 01, 2016, 07:28:24 by Mathias (Author) »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: How to create a shortcut?
« Reply #6 on: May 31, 2016, 22:35:32 »
I tried your code, first as a Custom Command and later as Multi-Script but it refuses to do anything when I call it by the assigned HotKey Ctrl+Shift+Alt+L. I tried assigning a different HotKey Ctrl+Alt+L but that seemed to pull up some different command for finding files, even though it did not say there was a conflict when I assigned the HotKey.

Ctrl+Alt+<anykey> is quick search, It overrides any hotkeys.. you can change that in Explorer Panel settings and also turn it off

andrewkirk

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: How to create a shortcut?
« Reply #7 on: June 02, 2016, 10:41:31 »
Thank you very much Alan and Matthias

I downloaded the portable version again and now I have both the missing menu entries.
Alan I will certainly try using that debugger you mention because I want to try setting up a few Multi Script custom commands once I get the hang of MC.