Execute dos command with selected files as parameters

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Sander Bouwhuis
Posts: 249
Joined: 10 Jun 2008 15:40
Location: Netherlands

Execute dos command with selected files as parameters

Post by Sander Bouwhuis »

As the title states, how do I execute a dos command with selected files as parameters?

I went to the 'Manage User-Defined Commands' window, and added the following to the 'Open' category:

"E:\Utilities\Hash\Hash.exe" "-r" "-hash=md5" "<items>"
The result:
E:\Utilities\Hash\Hash.exe -r -hash=md5 <items>

I also tried this:
"E:\Utilities\Hash\Hash.exe" "-r" "-hash=md5" "<curitem>"
The result:
E:\Utilities\Hash\Hash.exe -r -hash=md5

Note that I do have (multiple) files selected.
Thinking that the native commands didn't work, I tried the following:
"E:\Utilities\Hash\Hash.exe" "-r" "-hash=md5" "<curpath>"
The result:
E:\Utilities\Hash\Hash.exe -r -hash=md5 E:\Temp\Boink bla

So, some native commands seem to work, but others not(?)

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

I think you will have to use openwith rather than open.
I am quoting this from wiki:
Use Arguments

You can also use arguments to be sent when launching the application, in fact XY gives you full control over the command line that will be used. In order to activate this feature you have to put the application's name/path in between quotes.

After that, you can define whatever arguments you'd like, and you can even XY variables. For more on those, please see here. Note that this is about the Open With command, and that obviously the variables relating to items (eg. <items>) do not apply for the Open command.
.

Sander Bouwhuis
Posts: 249
Joined: 10 Jun 2008 15:40
Location: Netherlands

Post by Sander Bouwhuis »

Aaaaaahhhhh, that was it!

The manual did mention the first part, but not the second part. I interpreted 'open with' as it is used in Windows.

Many, many thanks for the help!

Post Reply