Testing RAR & Zip Files Within DO

Is there anyway of testing the above file types within DO, or can you only use right click, open with RAR or ZIp, then use the internal test option.

Have searched the forum but haven't come across any answers, as such. First Time User
TIA
Kev

1 Like

Hi and welcome to the forum.
What do you mean by testing ?
DO can open such files (navigating into them as if they were folders) and can create zip file (with command Copy ADDTOARCHIVE=.zip.

In scripts, Archives can be "scanned" as if they were folders also (DOpus.fsUtil().readDir function).

Opus can pass files to 7-zip and WinRAR via command line, e.g.

"/programfiles\7-Zip\7z.exe" t {filepath}
XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>7z Test</label>
	<function type="batch">
		<instruction>@nodeselect</instruction>
		<instruction>&quot;/programfiles\7-Zip\7z.exe&quot; t {filepath}</instruction>
		<instruction>pause</instruction>
	</function>
</button>

How to use buttons and scripts from this forum

I know i can use the Archive Files button in DO to create either rar or zip files, but once they have been created, i have to open them with their designated program to test them, just in case there are any faults within the archive file before I copy them on my NAS for storage.
What I would like to do is select a file then have a designated button on the toolbar to open and test the file and its contents ......... is this possible with a script ?

I don't think DO has built-in functions for that, but it's easy with an external program like the command line version of 7zip in the example by @lxp above. With the t option it can test the integrity of an archive. Then you just make a button with that command, select your file and you're good to go.

Many thanks for the help and info, have managed to create what I need by using the command editor, the 7-Zip command functions just as i want it to but the Winrar one does not show the results i.e. closes down immediately after testing.
Have looked at Winrar command switches to make it pause before closing, but with no luck :frowning:
Any ideas ?
TIA

Have you tried running it as an MS-DOS Batch Function and adding @leavedoswindowopen?

Just tried it, just leaves a blank command prompt page …..
The 7-Zip one works great, gives me all the required info, number of files, sizes, test passed etc.
The WinRAR one shows me the testing process but then just closes after the test, with no info.
I'm thinking its got to be a switch, but I'm at a loss which one it should be :face_with_raised_eyebrow:

Could you post the command you have right now?

This is in Standard Function
@nodeselect
"/programfiles\WinRAR\WinRAR.exe" t {filepath}

Try unrar.exe instead. Should be in the WinRAR folder as well and also takes the t command.


A quick screen grab on what happens, both commands are the same

Strange, it works fine for me and looks completely different.
Here's my complete button (just drag it onto the toolbar in customize mode):

Testing.dcf (365 Bytes)

Note this:

Btw, instead of @leavedoswindowopen you can also add a line at the end with pause - then you just have to press any key to close the window.

Hth.

From the WinRAR docs:

That's what I was looking for :+1:
That switch also works in standard function mode with Winrar's GUI as well as command line mode.
Many thanks lxp
Many thanks to all for putting up with me, no doubt I'll be back with more questions, sooner or later :laughing: