ZipIt : Open selected files as zips

ZipIt is a script add-in command for Directory Opus, that allows users to seemingly opens selected files, if possible, as if they were zips.

How this works:

The command creates a temporary link (hardlink or softlink) to the file but with a .zip extension.
Then, that file can be opened by Opus as a normal zip.
The command monitors the open tabs to remove the temporary files as soon as they are closed.
Also, when Opus starts, the command will remove any leftover temp file links it created.

:warning: IMPORTANT: READ BEFORE PROCEED

This script is provided "as is" and without warranty of any kind or whatsoever.
It has been made during my spare time and has not been extensively tested, so it is presented as a testing version.
The user assumes full responsibility for its use and understands that the author is not responsible for possible failures or loss of data.
Kind remind that this is a work in progress, so expect bugs.
Any feedback on possible improvements or bugs is welcome.

How to Install

:warning: IMPORTANT: Needs at least DOpus v13.16.1
Download the file below. Then go to Settings / Scripts (or run Prefs SCRIPTINSTALL) and select the downloaded file.

v2.0.0 : Download from here

Options

In the Script Management window, select ZipIt and click in the Edit button.

  • log level : Logging level to be displayed.
    • OFF to show only errors.
    • DEBUG to show all messages.
    • STANDARD to show only the most relevant information.
    • WARNING to show messages that needs your attention.
  • relative temp path : Relative path to the folder where temporary links will be stored. Note that this value is appended to each root disk.
    E.g. config_relative_path = my_temp_folder\temp_hardlinks will result in the temporary path being x:\my_temp_folder\temp_hardlinks for files on x:\ used with this command.
  • config_valid_exts : List of extensions that will be considered by the command. Leave empty to use all extensions.

Usage

ZipIt supports the following arguments:

Command Arguments

ARGUMENT TYPE VALUE DESCRIPTION
CONFIRM /S Show a confirmation before open any file.
DUAL /S Open the zips in a new tab in dual mode.
FILES /M Specify the files the command will act upon.

Notes / Technical Stuff

  • If the file is located in the same disk as /temp directory, a hardlink will be created in that folder.

  • If the file is on a non NTFS disk, a softlink will be created in /temp.

  • Otherwise, a hardlink will be created at the root of the disk in the relative folder specified in relative temp path or a folder named .DO_aszip_temp by default.

  • Whenever possible, the command automatically removes these temporary links, except in cases such as when a lister with the pseudo-zips still open is closed.

  • When uninstalling the script or when Opus starts, the command will remove any leftover temp file links it created.

Changelog

v2.0.0 (11-08-2025) :

  • General code improvements.
  • You can now open files as ZIP even if they're nested inside other ZIPs.
  • The command now supports piping with other commands, e.g., with this one.
  • New argument: FILES, to specify which files to use.
  • The script now cleans up leftover file links it created when Opus starts.

v1.0.0 (Dec 28, 2024) : Initial release

5 Likes

@errante
Open a file "as if" they were archives? It's probably a stupid question, but what exactly is the situation in which someone would need this? What does it attempt to solve?

Lots of file types are really Zip archives with another extension, and this gives you a way to look inside them.

Yeah, I just wanted to edit my post, on second thought. It's obvious indeed. I was thinking DO already does this (comic books like .cbr and .cbz are opened by DO as if they were zip files) - but of course, this does not happen for, say, docx word documents etc.

Indeed useful, it eliminates the manual hence-and-forth renaming of the file's extension.

I feel stupid, but how do I actually use the script? I have it enabled and everything, but I’m not sure how to execute it on a file. I’ve read the docs about scripts, but they weren’t helpful in that regard.

You need to have a zip-like container file selected in the lister.

Then you can click a button that you first create, with in it the simple command:

ZipIt

It facilitates the task of looking inside .zip or .rar type files that do not have this extension, so Windows does not always open them when you double-click them. Think of .docx and .docm Word files, .cbz and .cbr (comic book) files, or Directory Opus .osp script files. So instead of double-clicking them, you select them and click the button. They also open in a new tab this way, so you can simply close the tab when done.

I have it set up like this:
In the File Types dialog (Settings > File Types… by default), for "All files", under the "Events" tab, I've assigned "Middle double click" to:
ZipIt

v2.0.0 (11-08-2025) :

  • General code improvements.
  • You can now open files as ZIP even if they're nested inside other ZIPs.
  • The command now supports piping with other commands, e.g., with this one.
  • New argument: FILES, to specify which files to use.
  • The script now cleans up leftover file links it created when Opus starts.

I forgot to upload an update for this command earlier, so here it is. It should be a lot better than the previous version, but let me know if you run into any issues.

2 Likes

Oh yeah, I know what the purpose of the script is, I just didn’t know how to actually “run” it after installing. Created a button and it works like a charm now, thanks!

Thank you for another suggestion on how to make it work!

1 Like