XtremeMaC Posted December 4, 2008 Share Posted December 4, 2008 (edited) this is an example folder structure:c:\PICTURES\folderAA\c:\PICTURES\folderAA\01\c:\PICTURES\folderAA\01\*many many files*.jpgc:\PICTURES\folderAA\02\c:\PICTURES\folderAA\02\*many many files*.jpgc:\PICTURES\folderAA\03\c:\PICTURES\folderAA\03\*many many files*.jpgc:\PICTURES\folderBB\c:\PICTURES\folderBB\01\c:\PICTURES\folderBB\01\*many many files*.jpgc:\PICTURES\folderBB\02\c:\PICTURES\folderBB\02\*many many files*.jpgc:\PICTURES\folderBB\03\c:\PICTURES\folderBB\03\*many many files*.jpgand this is the rar files that i want to create:c:\PICTURES\folderAA\c:\PICTURES\folderAA\01.rarc:\PICTURES\folderAA\02.rarc:\PICTURES\folderAA\03.rarc:\PICTURES\folderBB\c:\PICTURES\folderBB\01.rarc:\PICTURES\folderBB\02.rarc:\PICTURES\folderBB\03.rarno folderAA/folderBB.rar no pictures.rar so far I've gotten this:for /F %%f in ('dir /aD /B') do (rar a -r -cl -m0 -df -md64 -ee -ep %%f.rar %%f\*.*)for /F %%f in ('dir /aD /B') do rd %%f /Q >>I use this to delete the sub folders...in rar command line switches -r means Recurse subdirectories now I can place the batch file into folderAA and folderBB folders manually and run them manually. it works.but i've lots of folders under PICTURES folder so i really don't want to do this manually.now I tried to put for /F "eol= delims=" %%A IN (dir.txt) do rar.....but then I get folderAA.rar having the contents of folder 01/02/03..I tried to put several variables with tokens but i wasn't able to get anywhere..dir.txt contents are are shown above..I know if i put more hours to this I can figure it out but i know there are batch gurus that'll make this in matter of seconds so help please. TIA Edited December 4, 2008 by XtremeMaC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now