Page 1 of 1

Execute dos command with selected files as parameters

Posted: 14 Jul 2008 21:29
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(?)

Posted: 15 Jul 2008 06:04
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.
.

Posted: 15 Jul 2008 09:15
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!