ContextMenu LABELRAW Extract to "1\"
This is a command automatically copied from the context menu, I paste it into the function and it doesn't work, I think it's because of the backslash in the path, I try to escape the path but it doesn't work either, how can I handle it correctly?
Where are you running that command from?
What are you aiming to do?
Which tool's context menu does it come from?
I found this out by accident
The "1\"
in that label is because you must have selected 1.rar
or a similarly named archive. The menu item label will be different for each archive and isn't the best way to find the command.
When I use ContextMenu SHOWCMDS
on a rar file, the command Opus generates for that menu item is this:
ContextMenu VERB="WinRAR_Extract" LOOKUP
That should work with all archive names. Although there are more direct ways to run WinRAR.exe, and you also do not need to use WinRAR to extract RAR archives in Opus. Opus has built-in commands for doing that.
Some menu commands are dynamic, if the menu does not have a verb, then it may not be able to execute, I just tried, it is not a backslash or space problem.
Although it is a dynamic label, but I can get through powershell and execute this menu command, but if this is a sub-menu I have no way, of course, this is just an example, I will not specifically define a button, and then use this way to decompress, I just reflect this problem
Translated with DeepL Translate: The world's most accurate translator (free version)
You don't have to use the label to run that WinRAR command. It has a verb which doesn't change.
But you also don't have to use Context Menu items to extract RAR archives in the first place. There are far better ways to do this than either approach that uses Context Menus. Context Menus should only be used to run commands from other places if there's no better way to do the same thing.