View Single Post
Old 01 January 2012, 20:46   #1
Leandro Jardim
Registered User
Leandro Jardim's Avatar
Join Date: Nov 2009
Location: Legoland
Age: 39
Posts: 1,196
Compress all adf's in a directory (Windows)

This a tip for everyone that uses WinUAE and have an ever growing software collection of adf's and iso's. Its easy to compress all iso's or adf's inside a directory simply by clicking on a icon. But the tips I show here is for the 7z archiver ( For other archivers, the syntax of the command varies.

Beware, using the MSDOS script below in a wrong way you can delete your floppy images without ever asking you first, can create empty archives and can create files with strange names. You need to have a basic understanding of MSDOS scripting to fix these problems yourself.

Beware, beware!

Open notepad, enter the text below and save to the same folder where lives the files you want to compress appending the extension ".bat" to the filename:

To compress to .zip enter:

for %%F in (*.adf) do "7z.exe" a -tZip "" "%%~nxF"
Or to compress to .7z:

for %%F in (*.adf) do "7z.exe" a -t7z "%%~nF.7z" "%%~nxF"
Replace the (*.adf) to (*.iso) or whatever the extension of the files are and replace "7z.exe" to the entire path of the 7z command line tool (in my computer it is "C:\Program Files\7-Zip\7z.exe").

Now you can click on the icon of the file you created, and it will compress all files with that extension. In fact, you can drop the script to any folder, and when you click the script icon it will automatically compres all filer inside there.

If you want, you can automatically delete all adf's to remain only the zipped files. Beware, it works this way: before you save the text file, append below all text you entered on notepad, the following:

 for %%F in (*.adf) do del "%%~nxF"
Pay attention to enter the text correctly or bad things may happen. Again, you need to replace the (*.adf) to the kind of file you are working on, for example (*.iso). And its done!

If you need help with MSDOS scripting, you can issue the MSDOS help system entering "help" with the name of the command you want to know about.

Last edited by Leandro Jardim; 01 January 2012 at 21:02.
Leandro Jardim is offline  
AdSense AdSense  
Page generated in 0.06115 seconds with 10 queries