Multi Commander > Support and Feedback

Relative path

(1/3) > >>

espkk:
How to use relative paths in MC cmd? Trying to exec ..\npp\notepad++.exe has no effect. cd ..\npp\ and running directly from cmd.exe folder works fine

Mathias (Author):
It depends on what command type you use.

You must use a Tag or command that expand to ful path becuse depending on command the how it is launch working folder is the path of the current viewed folder and not MC exe path

If the command is of Customcommand type then you can use any of the following Multitags
http://multicommander.com/docs/multitags

espkk:
Thank you for the link. It solves the problem, but I still have a question
Is it possible to use relative path in MC address bar/alias(AFAIU they works the similar way)? I mean, is it possible to run X:\Folder1\file.exe from X:\Folder2\ opened in current tab without using scripts or sequence "cd+filename". It may look weird though sometimes it's useful

Mathias (Author):
relative to folder used to work from the commandline field. But MS changed how a API worked because of security issues. So it does not automatically work anymore.
You can do tricks with script i believe to make it kind of work by making the script that is run then launch the parameter as a command.  "r ..\do.exe"

I have on my todo list to add some kind of workaround. I will see of I can get around to do that..

espkk:
Thank you for your answer.
It's not perfect way but works for me:

--- Code: ---function GetArgs()
{
  @var $args = "";
  @var $n = 0;
  for( $n = 0; $n < $argcount; $n = $n + 1 )
  {
    if( $n > 0 )
    {
       $args = $args + " ";
    }
    $args = $args + $arg($n);
  }
  return $args;
}
@var $exec = GetTagValue("${sourcepath}") + GetArgs();
MC.Run CMD="{$exec}";
--- End code ---

It seems that MC.Run base path equils ${mcinstallpath} + "\", is this always the truth? Also, I have confused why this code works:

--- Code: ---@var $exec = GetTagValue("${mcinstallpath}") + "\..\app\app.exe";
MC.Run CMD="{$exec}";
--- End code ---
and this code also works:

--- Code: ---MC.Run CMD=" "..\app\app.exe";
--- End code ---
and this is not:

--- Code: ---MC.Run CMD= GetTagValue("${mcinstallpath}") + "\..\app\app.exe";
--- End code ---
What's the problem?

Navigation

[0] Message Index

[#] Next page

Go to full version