program to batch extract archives

Discussion in 'Software' started by yedda_2000, Sep 8, 2006.

  1. yedda_2000

    yedda_2000 Private E-2

    So not a true major geek, just a cadet. Need to know if there is a way to batch extract zip and rar files that are stored in individual directories to those directories. For instance, hundreds of downloaded custom content for a game, all in rar or zip, all organized into individual subdirectories, need to be batch extracted, keeping all content in those subfolders. Possible?
     
  2. matt.chugg

    matt.chugg MajorGeek

    winrar has a command line utility, I expect it could be achieved with that, winrar also has a right click option where you can select multiple archives, right click and select 'Extract Each Archive To A Seperate Folder' and it will create a directory for each archive and extract the contents to the relevant folder
     
  3. yedda_2000

    yedda_2000 Private E-2

    I don't think this is what I'm looking for. I don't see any commands for the command line that do what I need. The ability to extract multiple archives into newly created individual folders, one for each archive, isn't what I'm looking for. This would still all be put into a single folder, with the file path from that folder being one layer deep (assuming the archive contains no subfolders).

    Lets say what I'm doing is selecting the whole of hard drive D, searching the whole drive for archives, and extracting all archives to the folders in which they are individually located. This means that the destination folder is not static. Winrar and winzip seem to only be able to extract to one destination folder per process, either a pre-defined one or the current one. I need to go through hundreds of files, in a very complicated tree of subfolders within subfolders, and strip each archived file down to the contents, maintaining that very same tree structure of subfolders within subfolders. Something like

    searchpath = Ddrive and all subfolders
    repeat while 2 = 2
    y = findfile *.rar
    z = folderpath(y)
    extract(y) to z
    deletefile(y)
    if findfile *.rar = false then end repeat


    (not exactly a true programing language, but should give a clearer idea of the logic I'm looking for)
     
  4. mondrawy

    mondrawy Private E-2

    you could go to the root directory where the rars are located, search for all .rar files then right click and choose extract each archive to seperate folder. No need for batch files or any other hassle.

    But I'm not quite sure this will work for you as you stated that the archives aren't static. Can you please explain more ?
     
  5. yedda_2000

    yedda_2000 Private E-2

    Mondrawy, what happens when I do this is that all the created separate folders are put into a single location rather than the individual locations of each archive. This is what I mean about the destination folder being not static vs being static. The place where all the extracted separate folders end up is the destinatation folder, and this remains the same (is static) for all the archives that are extracted, but I need the destination folder to change for each archive (not be static)

    example:

    I have folder TEMP, within that: (1.rar, 2.rar, 3.rar and folder TEMP_2).

    Inside TEMP_2: (4.rar and 5.rar).

    If I run a windows search for all rar files within TEMP (including subfolders), select all the found rars, right click and choose separate folders, I get Folders 1,2,3,4,&5 all in TEMP2

    What I need are folders !,2,&3 to be created in TEMP(as that is the folder that had those rars in it), with only 4&5 in TEMP2.

    Searching the root and all subfolders, I can extract to separate folders(first thing I tried), but those separate folders all seem to go to one place, and this is not what I need.
     
  6. yedda_2000

    yedda_2000 Private E-2

    To make this even more obvious, I'll change the names in my example

    I have folder FOOD, within that: (Food1.rar, Food2.rar, Food3.rar and folder CAKE).

    Inside CAKE: (Cake1.rar and Cake2.rar).

    If I run a windows search for all rar files within FOOD (including subfolders), select all the found rars(Food1, Food2, Food3, Cake1, & Cake2), right click and choose separate folders, I get all the folders (Food1, Food2, Food3, Cake1, & Cake2) in the CAKE folder.

    What I need are folders Food1, Food2, & Food3 to be created in the FOOD folder(as that is the folder that had those rars in it), with only the Cake1 and Cake2 folders in CAKE.
     
  7. mondrawy

    mondrawy Private E-2

    thats odd, I just tried it and its like you said not working, one would think "extract to seperate folders" would fix this.

    Well, you could try making a batch file with the winrar command line utility, personally I've never tried it so I don't know if it'll work. I don't know if you can search through stuff with batch files.

    If you can program you can try writing a program that will traverse through folders and subfolders looking for the extension .rar and then asking winrar to extract. I have a similar program that does traverse through files looking for a certain extension but it doesn't extract, its certainly easy to write if you are good with programming.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds