topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 4:04 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DOpus function to emulate maketree/ZeroZipper  (Read 3097 times)

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,643
    • View Profile
    • Donate to Member
DOpus function to emulate maketree/ZeroZipper
« on: July 06, 2012, 02:54 AM »
Didn't quite know where to put this, (didn't want to tack it onto skwires thread), since it's kind of application specific, (ie. you need Directory Opus 10), but changing the internal DOpus arguments and replacing the second line with an external archiver will turn it into a batch command file.

Rather simple, took me a couple of minutes to write...but an hour to work out why it wasn't working.  It's only been tested on dual pane listers, it gets imported as a custom User Command and then you can add it as a Context Menu item, (ZeroArc), for folders.

Anyway, a couple of days ago I was playing around with RoboCopy, noted the /CREATE switch and the rest is history as they say.

Code: Text [Select]
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <usercommand backcol="none" hide_from_menu="no" textcol="none">
  3.         <label>ZeroArc</label>
  4.         <tip>Produce a file tree archive</tip>
  5.         <user_label>ZeroArc</user_label>
  6.         <icon1>#default:newzipfile</icon1>
  7.         <function type="normal">
  8.                 <instruction>@runmode hide</instruction>
  9.                 <instruction>@nofilenamequoting</instruction>
  10.                 <instruction>@sync:robocopy &quot;{filepath|noterm}&quot; &quot;{destpath$}{file}&quot; /CREATE /E /np /nfl /ndl /njh /njs</instruction>
  11.                 <instruction>COPY MOVE ARCHIVE=.7z,KEEPFOLDER &quot;{destpath$}{file}&quot; AS &quot;{file}&quot;</instruction>
  12.         </function>
  13. </usercommand>

Creates the zero length files/folder structure in the destination lister and then moves it into a 7-Zip archive - on my machine it did 27272 files/223 folders in about 20 seconds, (to RAM or HDD).

Change the .7z to .zip if you want a ZIP archive.

Anyway, hope it's useful for someone.

UPDATED: Forgot to take spaces in names into account.
« Last Edit: July 22, 2012, 02:02 AM by 4wd »