Oct
21
2008

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")
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Comments

Leave a Comment

Login using OpenID or enter your details below to leave a comment.

OpenID
Anonymous


Comment

Powered by WP Hashcash