Multi Commander > Support and Feedback

How to Drop&Run?

<< < (2/3) > >>

Mathias (Author):

--- Quote from: commander on May 17, 2024, 12:41:49 ---I see. Is that possible to use Alt or Shift as the modifier key? They are not used, right?
Please consider to follow the parameter convention. Currently, my programs can not recognize the file path.

--- End quote ---
Not sure what you talking about parameter convention..  The dropped file are sent as a parameter to the file it is dropped on. just like you would call it on the command line.
App.exe <Path of dropped file>

commander:
When you drag a file onto an executable file (e.g., a .exe file) in Windows Explorer, Windows passes the full path of the dragged file as a parameter to the executable.

For example, if you have a file named example.txt located at C:\Users\User\Documents\example.txt and you drag this file onto an executable named processfile.exe, the executable will receive the file path as an argument.

When you drag example.txt onto processfile.exe and run it, the output will look something like this:

Argument 0: C:\Path\To\Executable\processfile.exe
Argument 1: C:\Users\User\Documents\example.txt

argv[0] is the path to the executable itself, and argv[1] is the path to the dragged file. If multiple files are dragged, they will be passed as additional arguments (argv[2], argv[3], etc.).

Mathias (Author):

--- Quote from: commander on May 17, 2024, 19:05:23 ---When you drag a file onto an executable file (e.g., a .exe file) in Windows Explorer, Windows passes the full path of the dragged file as a parameter to the executable.

For example, if you have a file named example.txt located at C:\Users\User\Documents\example.txt and you drag this file onto an executable named processfile.exe, the executable will receive the file path as an argument.

When you drag example.txt onto processfile.exe and run it, the output will look something like this:

Argument 0: C:\Path\To\Executable\processfile.exe
Argument 1: C:\Users\User\Documents\example.txt

argv[0] is the path to the executable itself, and argv[1] is the path to the dragged file. If multiple files are dragged, they will be passed as additional arguments (argv[2], argv[3], etc.).

--- End quote ---

yes Arg1 is the first parameter to the program. argv0 is always the exe of the program it self. it is not something any program sent to it.

commander:
I figure it out now, thank you. When I run python script.py, there is only one argv[0]. I need to run python3 script.py to get two arguments.

lh42:

--- Quote from: Mathias (Author) on May 17, 2024, 10:17:17 ---Drop to run in filelist conflict with the Copy and replace feature.. (Drag file to replace another)

--- End quote ---
I also would like to have the ability to just drop files on an executable or a batch file or else to launch it as a parameter. This would be much more useful to me than the replace option. It would be nice to be able to configure which behaviour should be used or to toggle it with an unused modifier key.
The workaround with Quick Launch Bar or Button panel is only useful when you only have few applications to use.
By now I have to temporarily switch to another explorer :( when I have to use this functionality although I use Multi Commander for all the other stuff.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version