Batch File/dos Help


yaustar

UK GP32 & GP2X Owner
Joined
Oct 18, 2003
Messages
2,714
Location
UK
Website
Visit site
What I am trying to do is to compress a folder full of files into indivdual archives (one file per archvie).. My problem is that I cant find the syntax for doing one file at a time, I can do an group of files by date, wildcard etc but not 1 by 1..

Is it actually possible?
 
trooper posted on Aug 6 2005 at 05:06 AM said:
WinRAR.

Trooper

I have to agree, I used WinRAR to compress a very larger folder full of stuff into lots of small archives (one file per archive). It's very useful for compressing Genesis, Snes and Nes roms for use on the GP32.
 
Last edited by a moderator:
If you are doing it in a dos batch file, it might be prudent to get a copy of pkzip.exe and copy it to your windows system32 folder. You can then use pkzip in a batch file to do it.

If you need to know pkzips options, type pkzip /? into a command prompt!
 
Already have the 7zip commandline on my drive, is there any other freeware tool that can do this besides winrar?

edit: Nevermind.. I think I am sorted, just need to replace the DO part of loop to zip the archives..
FOR %c in (C:\windows\desktop\*.*) DO echo %c

edit:
Well it's crude but it works:
Code:
:: Zips all files from this directory into individual archives into the parent folder
@ECHO OFF
ECHO.

:: For all files in the directory, zip them into a directory above.
ECHO Compressing files
FOR %%c in (*.*) DO "E:\7-zip\7z" a -tzip "../%%c.zip" "%%c" -mx=5

:: Rename the files from .%1.zip to .zip
:: Back up a folder
cd ..
ECHO Renaming files
REN *.zip *.
REN *.nes *.zip
del zip.bat

PAUSE
 
Back
Top