Author Topic: Conditional custom commands  (Read 15203 times)

Tolis

  • Junior Member
  • **
  • Posts: 18
    • View Profile
Conditional custom commands
« on: June 06, 2016, 20:05:26 »
Hi,

I use a portable version stored in my google drive so I have MC in synch everywhere. The problem is that I need to create different version of my commands for each pc based for example in the machine name. So how should I proceed?

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Conditional custom commands
« Reply #1 on: June 14, 2016, 07:41:59 »
Depends on what you mean with "my commands"  is is UserDefinedCommands (script ?) shortcut in Menu/Buttonbar  ? QuickLaunchBar ?
Most of this things will store its configuration in its own files. you can create copys of them that you copy in place with a bat script before start or something.

It is hard to say without know exactly what the issue is

Tolis

  • Junior Member
  • **
  • Posts: 18
    • View Profile
Re: Conditional custom commands
« Reply #2 on: June 14, 2016, 07:46:34 »
thnks for the reply, at the moment I m not so advance to script (I will do it for sure though). I am interested in supporting machine depended versions of simple userdefined commands, mostly goto path shortcut where i want to have the same shortcut across my machines but I need to open a different path

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Conditional custom commands
« Reply #3 on: June 14, 2016, 07:59:19 »
MC do support relative paths. Maybe you can use that and it will work on all machines..
But if you have really machine specific things, different shortcuts or they are really on different path, so relative paths can be used
Then you need to start MC with some .bat script that first copy the correct file from a storage into MCs config folder.

If you look in the config folder you see that ever major thing have there own config file..  all UserDefinedCommands are stored in its own files. All QuickLaunch buttons are in its own. ButtonPanel setup have its own and so on.

But it can cause issus if you start it from a cloud drive. Becuse if the settings files are changed it will sync it and if you run on multiple machines at the same it might maybe cause strange issues and they will overwrite each others settings.

Best would be if you can use relative path. or use Multiple instances of MC with its own setup

Tolis

  • Junior Member
  • **
  • Posts: 18
    • View Profile
Re: Conditional custom commands
« Reply #4 on: June 14, 2016, 08:04:32 »
hmm yes i do use it from a cloud drive what exactly do u mean by relative paths?

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Conditional custom commands
« Reply #5 on: June 14, 2016, 08:09:14 »
Path that are relative to MC..
Instead of using a absolute path like C:\My Program\MyProgram.exe  you use a path that are relative from MC.   eg "..\..\..\MyProgram\MyProgram.exe"

QuickLaunchBar and FileTypeSetup and some other places have a button for converting the path to a relative path automatically. (if possible.. target and MC must be on same drive)

Tolis

  • Junior Member
  • **
  • Posts: 18
    • View Profile
Re: Conditional custom commands
« Reply #6 on: June 14, 2016, 11:10:02 »
maybe i do not get it but how this can make any difference? I mean relative or not the paths are different

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Conditional custom commands
« Reply #7 on: June 15, 2016, 18:59:21 »
Well as I said, It depends.. I don't know how everything is setup for you and what exactly you are trying to do
Normally when you run the portable version on multiple machines then you have relative path for shortcut so they work on all machines.

But if everything is different then it does not of course not work.

But if everything is different, what is the point of running it from a shared location (cloud synced folder)
Why not just copy the machine specific setup to that machine ? The point of having a shared portable version running on multiple machine is to have it be the same on all machines