I have a command line application I use fore extracting files. Currently I'm using a batch file, but I have to drag-and-drop each file onto the batch file, so I want to add a context menu item for ease of use.
My batch file looks like this:
extract "%~1" -o "%~dpn1"
extract extracts and archive or and sfx archive (exe) -o sets the output directory.
This is what my registry looks like:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\extract]
"MUIVerb"="Extract to SubDir"
[HKEY_CLASSES_ROOT\exefile\shell\innoex\command]
@="D:\Programs\extractor\extract.exe "%~1" -o "%~dpn1""
The ~ signs are, apparently, not recognized here, so I removed them and it worked, except not the way I wanted it to.
Foo.exe gets extracted to a directory called Foo.exepn1.
So I changed the command to:
extract "%1" -o "%d"
This, however doesn't work at all.
So, instead of trying out to see what works from the registry, I need the correct syntax that will work. I've been browsing MSDN for a while now, but I can't find the answer.
Bonus question: %1 presumes first command passed. Can I pass more than 1? i.e. can I select multiple files and extract them one AFTER the other? Currently, I see multiple command line windows, all extracting at the same time.
extract "%1" -o "%d1"? – Wasif Jun 21 '20 at 01:10Foo.exe1, I need a directory namedFoo– George Hovhannisian Jun 21 '20 at 01:17%d1with%dpn1? – Wasif Jun 21 '20 at 01:27Foo.exepn1, And%ddoesn't extract at all. – George Hovhannisian Jun 21 '20 at 02:02extractand what's its-oparameter meaning?where /R c:\ extractreturns INFO: Could not find files for the given pattern(s). 2. Please [edit] the question and share the context menu item from registry. – JosefZ Jun 21 '20 at 14:51