batch conversion of roms
Posted: Sun Jul 15, 2012 7:57 am
here are 2 nice batch files (to create a .bat file just create a txt file using right click, create txt file, copy the following text, and rename the .txt into .bat)
important, if you have win x64 install 7zip x64, if you got win 32 instal 7zip32
notice: you can batch extract all zipped files selecting them all, right clicking, then selecting extract here option... after doing that move all extracted files and place 7zipall.bat in the newly created or previously emptied folder.
compress all files in a folder into 7z format max compression non solid with multi-threading on:
(call the file 7zipall.bat it checks his name, while scanning all files in its directory to avoid 7zipping himself)
FOR %%i IN (*.*) DO IF NOT (%%i)==(7zipall.bat) "c:\Program Files\7-Zip\7z.exe" a -mx9 -mmt "%%i".7z "%%i"
----------------------------------------------------------------------------------------
now the tricky part: convert all .zip files into .7z (max compression, non solid, using multithreading):
call this file ZipTo7zORviceversa.bat
there is 1 little error left in the modified version of HowardC
error is: the command to make the .zip file deletable is run after the command to delete zip file... so zip file is not deleted, and 1 copy of it is compressed inside the .7z file...
example: game.zip is read only and contains game.nds
using batch file... inside a folder you have game.zip and game.nds... but when game.zip should be deleted... it refuse to cancel itself...
so a game.7z file is created with inside both game.nds and game.zip
at this point the "unprotect command" is run... game.7z is moved to the done folder... while game.zip and game.nds are deleted. but game.zip should have been deleted early... otherwise i now have an unnecessary copy inside the .7z
this is the last version of batch file... who fix this error:
@echo off
SET ConvertFrom=zip
SET ConvertTo=7z
IF NOT EXIST *.zip SET ConvertFrom=7z
IF NOT EXIST *.zip SET ConvertTo=zip
md temp
md done
:LOOP
FOR %%i IN (.\*.%ConvertFrom%) DO (SET varx="%%~ni")
IF NOT EXIST %varx%.%ConvertFrom% GOTO END
move %varx%.%ConvertFrom% .\temp\
cd temp
"c:\Program Files\7-Zip\7z.exe" e %varx%.%ConvertFrom%
attrib -r *
attrib +a *
del %varx%.%ConvertFrom% /Q
"c:\Program Files\7-Zip\7z.exe" a -mx9 -mmt %varx%.%ConvertTo% *
move %varx%.%ConvertTo% .\..\done\
del * /Q
cd..
GOTO LOOP
:END
rd temp
cd done
move * .\..\
cd..
rd done
Posts: 13
Joined: Wed Dec 29, 2010 4:00 am
----------------------------------------------------------------------
TIPS ABOUT ROMCENTER
1) find a way to have every rom 7zipped inside a personal archive (you have as many .7z files as the number or roms)
2) download from nointro datomatic site a "offline list compatible" dat file, choose parent/clone xml
3) extract the .dat file from the .zip archive and place the dat in .\romcenter\romcenter\datas
4)execute romcenter, new,choose dat file and save database
5)change preferences choose merge mode
6) add rom path, and then refresh, fix
7)choose rezip option (it will rearchive in .7z if you chose .7z in preferences)
my rom folder was about 350mb zip
went 230mb 7zipped
went 150mb 7zipped merge, then rezip (rearchive) it took a bit to decompress, recompress everything but in the end i found myself with a rom folder weighting less than half... (-57,1%)
important, if you have win x64 install 7zip x64, if you got win 32 instal 7zip32
notice: you can batch extract all zipped files selecting them all, right clicking, then selecting extract here option... after doing that move all extracted files and place 7zipall.bat in the newly created or previously emptied folder.
compress all files in a folder into 7z format max compression non solid with multi-threading on:
(call the file 7zipall.bat it checks his name, while scanning all files in its directory to avoid 7zipping himself)
FOR %%i IN (*.*) DO IF NOT (%%i)==(7zipall.bat) "c:\Program Files\7-Zip\7z.exe" a -mx9 -mmt "%%i".7z "%%i"
----------------------------------------------------------------------------------------
now the tricky part: convert all .zip files into .7z (max compression, non solid, using multithreading):
call this file ZipTo7zORviceversa.bat
there is 1 little error left in the modified version of HowardC
error is: the command to make the .zip file deletable is run after the command to delete zip file... so zip file is not deleted, and 1 copy of it is compressed inside the .7z file...
example: game.zip is read only and contains game.nds
using batch file... inside a folder you have game.zip and game.nds... but when game.zip should be deleted... it refuse to cancel itself...
so a game.7z file is created with inside both game.nds and game.zip
at this point the "unprotect command" is run... game.7z is moved to the done folder... while game.zip and game.nds are deleted. but game.zip should have been deleted early... otherwise i now have an unnecessary copy inside the .7z
this is the last version of batch file... who fix this error:
@echo off
SET ConvertFrom=zip
SET ConvertTo=7z
IF NOT EXIST *.zip SET ConvertFrom=7z
IF NOT EXIST *.zip SET ConvertTo=zip
md temp
md done
:LOOP
FOR %%i IN (.\*.%ConvertFrom%) DO (SET varx="%%~ni")
IF NOT EXIST %varx%.%ConvertFrom% GOTO END
move %varx%.%ConvertFrom% .\temp\
cd temp
"c:\Program Files\7-Zip\7z.exe" e %varx%.%ConvertFrom%
attrib -r *
attrib +a *
del %varx%.%ConvertFrom% /Q
"c:\Program Files\7-Zip\7z.exe" a -mx9 -mmt %varx%.%ConvertTo% *
move %varx%.%ConvertTo% .\..\done\
del * /Q
cd..
GOTO LOOP
:END
rd temp
cd done
move * .\..\
cd..
rd done
Posts: 13
Joined: Wed Dec 29, 2010 4:00 am
----------------------------------------------------------------------
TIPS ABOUT ROMCENTER
1) find a way to have every rom 7zipped inside a personal archive (you have as many .7z files as the number or roms)
2) download from nointro datomatic site a "offline list compatible" dat file, choose parent/clone xml
3) extract the .dat file from the .zip archive and place the dat in .\romcenter\romcenter\datas
4)execute romcenter, new,choose dat file and save database
5)change preferences choose merge mode
6) add rom path, and then refresh, fix
7)choose rezip option (it will rearchive in .7z if you chose .7z in preferences)
my rom folder was about 350mb zip
went 230mb 7zipped
went 150mb 7zipped merge, then rezip (rearchive) it took a bit to decompress, recompress everything but in the end i found myself with a rom folder weighting less than half... (-57,1%)