WinRAR Compress/Decompress Buttons (and other)

This is turning into a 'help and support' thread, so I expect Nudel or Tanis may come along shortly and break off some of this discussion into a separate topic... but FWIW:

The 'Add To Archive' button above shouldn't ever work as it's written... because the single {f} argument is passing the name of the selected file that you want to add to an archive as the new rar filename... so you get the following error:

! dontfindme.txt: The archive is either in unknown format or damaged

Which makes sense... given the command line usage in this button example... it's sort of missing an argument and trying to overwrite the selected file as if it was already an archive.

Normally. you might want to change the command-line to something like:

"C:\Program Files\WinRAR\WinRAR.exe" a {f|ext=rar} {f}

...which would "work" but would create a new rar file for each selected file if multiple files are selected.

So, I think for ppl that would WANT such a thing, maybe youd like to break this out into two separate buttons... one that runs the command above for an Add each file to a separate Archive, and another based on what TheCoach proposed for a more rounded out generic Add To Archive button... with a small edit or two:

Coach... your command has an unecessary {allfile} argument at the end... the button still "works" as I'd imagine winrar is just ignoring that last arg... but the {O} is giving you everything you need to pass all files.

ADDITIONAL NOTE: If you have LOTS of files selected when you run the command with {O} then it may bomb out with the error in the attached screenshot. This is probably due to a limitation in the length of characters able to be passed through the 'command line'. Version 9 of Opus added a new modifier that helps us get around this... you would modify the command in TheCoachs button to run:

"C:\Program Files\WinRAR\WinRAR.exe" a -r {Rs|Specify name for archive} @{O|filem}

What thois does is use WINRAR's ability to read a text 'listfile' which contains the names of all files to process, rather than passing all file names to the executable directly on the command line. The {O|filem} expression is Opus new modified argument that takes the file names provided by {O} and copies those names to a temporary file with each of the selected file names on a new line. Using {O|file} would place all filenames on a single line in the text file... but it looks like winrar likes one file per line...

Hope this helps... let's see which forum this thread ends up in :slight_smile:. Maybe we break out the 'discussion' into a help and support thread, and get LITWINCZUK and Coach to agree on reposting buttons with some of these considerations taken into account; and which have been tested and are known to work.

@LITWINCZUK: you've been generous in providing your way of doing things to others in the forums and mistook comments of mine in another thread for criticism/sarcasm... hopefully you don't feel the same about this post... just offering my views on things... cheers!