Rar All Files in a Directory
Comments available as RSS 2.0
I’ve spent the last half an hour tweaking this so it works. This batch file will loop through all files in the source directory with the specified extension and add each one to an individual .rar file with maximum compression.
As it is, it will add all files the the extension nds in the current directory to a new subdirectory called zipped.
@echo off SET winrar="C:\Program Files\WinRAR\winrar.exe" SET sourcedir=%cd% SET outputdir=%cd%\zipped IF NOT EXIST "%outputdir%" mkdir "%outputdir%" for /F "delims=" %%i in ('dir /b *.nds') do (%winrar% a -s -m5 -inul "%outputdir%\%%~nxi.rar" "%%i")

Comments
Leave a Comment