batch - Delete folders in subfolders

06
2014-04
  • MichelleP

    I have about 3000 folders Each folder contains

    titlefolder

    typefolder

    -content

    I need to get rid of the typefolder and have the content moved up one to the titlefolder. I know I can copy and paste and delete but having more then 3000 files to do individually that will take days. Thanks for any help you can provide

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    batch - How to make 7-zip do a whole bunch of folders
  • KdgDev

    I got a bunch of pictures that I had to crop into 800x600 pixels. That was easily done, but now I have to upload them so the family can see them all.

    Thing is, this is 500MB in pictures. I decided to simply zip the separate folders, which each contain an almost equal amount of pictures. This way I can upload a couple each day. Doing this manually is a very long and hard job. I wonder if there is a way to make 7-zip handle each folder individually?

    I think I'll need a batch file to do it, but I'm not good with that. I've put everything under one folder. In the various subfolders is where the pictures are located. What I need is for the contents of that folder to be zipped. I'm not sure if I can just zip the folder along with it. I know PHP has a zip module, I've just never worked with it, so I'm not sure whether it can handle the fact that the content of the zip is a folder which contains the items, instead of just the items.


  • Related Answers
  • user256245

    Run from a command prompt whose working directory is your My Pictures directory, this command will create a zip file of the contents of each subdirectory, leaving all of the zip files in your My Pictures directory.

    Edit: I have added the quotation marks necessary to allow for directories with spaces in their names.

    for /D %%d in (*.*) do 7z a -tzip "%%d.zip" "%%d"
    

    Also: The following version will not put files in a subdirectory inside of the zip file, but instead in its root:

    for /D %%d in (*.*) do 7z a -tzip "%%d.zip" ".\%%d\*"
    

    In Windows 7 and above

    for /D %d in (*.*) do 7z a -tzip "%d.zip" "%d"
    

    or

    for /D %d in (*.*) do 7z a -tzip "%d.zip" ".\%d\*"
    
  • roryok

    Tip: if you're images are JPGs, they are already compressed. use 7-Zip in 'archive' mode without compression (compression level: store) this will speed up the process tremendously.

    even if you use Ultra compression you will hardly gain 5%, certainly not worth the effort.

    I was thinking in terms of practically adding attachments.

    i wouldn't send them as email attachment. rather upload the to a so called one-click-hosting server (e.g. drop.io, rs, mu, ms, etc., choices are plenty) and then send the download link via email to your friends and family.

  • Indrek

    This answer is community wiki because I just want to clarify what you are trying to accomplish. If I understand correctly, you want to be able to create .zip files for the contents of each of the Pics* folders, not the whole structure, and not .zips that contain the Pics* folder itself, but rather the contents of the folder.

    • My Pictures
      • Pics1 (... Pics1.zip)
        • File1.jpg
        • File2.jpg
        • File3.jpg
      • Pics2 (... Pics2.zip)
        • File4.jpg
        • File5.jpg
      • Pics3 (... Pics3.zip)
        • File6.jpg
        • File7.jpg
      • ...
  • mtone

    7-zip has an option to UNZIP every file into its own folder (*/), but lacks the context commands to do the opposite action you are looking for.

    That said, I remember doing this exact thing using winrar in the past. There's an option "unique archive per folder" or something to that effect.

  • ldigas

    Try looking at this article (also, read comments below) : Zip a Folder Using Command Line

  • Kurru

    Get picasa and upload to picasa's web album. Then everyone can easily get the photos online and view them.Might be even able to upload the originals (so your family can print the larger versions)