0

I have a question regarding archiving on windows 7 and I will preface it with the problem in an effort to identify what solution I need.

  • Our workflow process dumps printable files to a numbered folder. eg JOB0150
  • The user outputs the printable files in each folder using the output device during the shift.
  • The user then at the end of his shift individually rightclickfolder > send to zip on each folder
  • Then drags the zip files into the archive after all folders have been zipped using above.

What I am wanting to do is automate this process as there are sometimes 400/500 folders that need to be archived at the end of a shift and one of our users has to literally sit there and waste 45 minutes of time at the end of shift 'archiving'. This is unproductive as each folder can easily be dragged into another folder which is then automated to zip the file and transfer it to the archive automatically. Or so I think.

I am wondering if there is any solution like 7zip or something that could automate a process like this?

1 Answer 1

0

As far as I can understand it, you want an archive full of archives of each folder? This sounds like a good job for a batch file, which can automate these sorts of tasks. Assuming you have 7-zip installed (which you mention), this should do the trick:

FOR /D %G IN ("JOB*") DO "C:\Program Files\7-Zip\7z.exe" a -tzip %G_archive.zip %G

"C:\Program Files\7-Zip\7z.exe" a -tzip final_archive.zip *_archive.zip

Replace C:\....\7z.exe with the actual path to your installation of 7-Zip. Make sure you use the 7z.exe file as that's the command line version of the application. You can then put this in a plain text file and save it as a .bat script and run it.

An annotated version of the script:

FOR /D %G IN ("JOB*") 
----- Iterate over each directory (/D flag) in the current directory that starts with JOB

DO "C:\Program Files\7-Zip\7z.exe" a -tzip %G_archive.zip %G
----- Run the 7z.exe file, put it in archive mode (a) for ZIP files (-tzip) 
----- ...and tell it to add the directory (%G) to an archive with the directory name plus "_archive.zip"

"C:\Program Files\7-Zip\7z.exe" 
----- Finally, run 7-zip again

a -tzip final_archive.zip *_archive.zip
----- and tell it to add all of the sub-archives into a file named final_archive.zip
2
  • Thanks! That will most likely do the job. I just have to work it out and make it run. Just another example of what I would like it to do if I could. User prints the files in the folder, User drags finished folder into a designated 'archive' folder, 7zip automatically waits for folders to appear, 7zip zips the folder with no name change, 7zip moves the folder to external 'archive' drive.
    – user414903
    Feb 3, 2015 at 21:27
  • You can also do it on a schedule
    – Moab
    Feb 8, 2015 at 3:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .