Windows 10: Issue when extracting multiple files within different folders at once

Discus and support Issue when extracting multiple files within different folders at once in Windows 10 Support to solve the problem; So I have a lot of .zips and .rars scattered around one of my hard drives. I wanted to extract all of these to the folders in which they lived in one... Discussion in 'Windows 10 Support' started by bobsagetfullhou, Mar 11, 2017.

  1. Issue when extracting multiple files within different folders at once


    So I have a lot of .zips and .rars scattered around one of my hard drives. I wanted to extract all of these to the folders in which they lived in one swift go. So I did a search and selected the .zips to test it out and chose "extract each archive to a separate folder". I used winrar to do this. What happened is archives did NOT all extract to the folder in which they lived. Instead they were ALL extracted to the folder in which the first archive lived. So I was not able to do this extraction of all the archives into their home folder like I liked and ended up having to manually extract one by one while in each archives folder. I also tried to extract with 7zip and had the same result.I'd rather not have to do this with the .rars. Has anyone encountered this issue and know of a fix?

    :)
     
    bobsagetfullhou, Mar 11, 2017
    #1
  2. dcw57 Win User

    Synaptics TouchPad won't stay dissabled

    When you first download the file it looks like a file folder with a zipper on it. (they compress the file to make it smaller for faster downloading) Right click on that and one of your choices should be to unzip or extract. It will extract them to a different
    folder with the same name but no zipper. Once that's done open the new folder and click on setup.exe.
     
    dcw57, Mar 11, 2017
    #2
  3. Unzip multiple files in same folder

    How can I unzip multiple files inside some folder in Windows 10?

    Only option available is to extract a file at once and with a popup window suggesting a folder with file name.
     
    AlmeidaAndre, Mar 11, 2017
    #3
  4. Michael Win User

    Issue when extracting multiple files within different folders at once

    Huh, you're right. Just tried it with WinRAR's "Extract Here" context menu entry from an Explorer search. It wants to put all the files in the first folder.

    You could do it like this from PowerShell:
    Code: Get-ChildItem Z:\YourDir -Include *.zip, *.rar -Recurse | ForEach-Object {& "C:\Program Files\WinRAR\WinRAR.exe" e $_.FullName $_.Directory}[/quote]
     
    Michael, Mar 11, 2017
    #4
  5. [/quote] Yeah, very weird. I'll give that a go. Thanks.

    Edit: Sweet that worked. Only thing is that it "extracted here" when I was looking for it to "extract to a separate folder". Would I be able to tweak this to do that? Thanks
     
    bobsagetfullhou, Mar 11, 2017
    #5
  6. Well I don't want to extract them all to a different location. I want them all to extract to a separate folder of the .zip file's name in the current directory the .zip lives.

    So c:\pictures\cats\catpics1.zip should unzip to c:\pictures\cats\catpics1
    and
    c:\pictures\dogs\dogpics1.zip should unzip to c:\pictures\dogs\dogpics1

    Would the below accomplish that?

    Code: Get-ChildItem Z:\YourDir -Include *.zip, *.rar -Recurse | ForEach-Object {& "C:\Program Files\WinRAR\WinRAR.exe" e $_.FullName $_.Directory\$_.BaseName}[/quote]
     
    bobsagetfullhou, Mar 11, 2017
    #6
  7. Michael Win User
    Whoops, I realized we should be using WinRAR's X command instead of E to preserve the archive's internal folder structure. And $_.DirectoryName is what we actually want, plus a bit more punctuation to get the string to behave. So yes, you almost had it.

    This will extract archives to folders of the same name, equivalent to "Extract to Folder" from the context menu:
    Code: Get-ChildItem Z:\YourDir -Include *.zip, *.rar -Recurse | ForEach-Object {& "C:\Program Files\WinRAR\WinRAR.exe" x $_.FullName ($_.DirectoryName+'\'+$_.BaseName+'\')}[/quote]
     
    Michael, Mar 11, 2017
    #7
  8. Issue when extracting multiple files within different folders at once

    [/quote] Worked like a charm! Thanks for your help.

    Edit: One last thing, I and I'm really not sure if there's a way around this. Is there a way so that it extracts one archive at a time? Right now if I have 20 .zips in a directory it will slowly extract all of them at once, bogging down the machine instead of waiting for the previous one to finish.
     
    bobsagetfullhou, Mar 11, 2017
    #8
  9. Michael Win User
    Oh right, hadn't realized because I've been testing with empty files that take a split-second to extract.

    You'll want to add this to the end, before the closing curly bracket:
    Code: ; Wait-Process WinRAR[/quote] So like:
    Code: Get-ChildItem Z:\YourDir -Include *.zip, *.rar -Recurse | ForEach-Object {& "C:\Program Files\WinRAR\WinRAR.exe" x $_.FullName ($_.DirectoryName+'\'+$_.BaseName+'\'); Wait-Process WinRAR}[/quote]
     
    Michael, Mar 11, 2017
    #9
  10. So like:
    Code: Get-ChildItem Z:\YourDir -Include *.zip, *.rar -Recurse | ForEach-Object {& "C:\Program Files\WinRAR\WinRAR.exe" x $_.FullName ($_.DirectoryName+'\'+$_.BaseName+'\'); Wait-Process WinRAR}[/quote] [/quote] Thanks for you help sir! Everything working how I'd like it.
     
    bobsagetfullhou, Mar 12, 2017
    #10
  11. So like:
    Code: Get-ChildItem Z:\YourDir -Include *.zip, *.rar -Recurse | ForEach-Object {& "C:\Program Files\WinRAR\WinRAR.exe" x $_.FullName ($_.DirectoryName+'\'+$_.BaseName+'\'); Wait-Process WinRAR}[/quote] [/quote] Hey, hate to be a pest, but had one more little issue. If it's extracting a rarset with multiple rars (Cat pics.part1.rar and cat pics.part2.rar) instead of extracting to a folder named Cat pics, it will extract to a folder named Cat pics.part1. Would there be any way to fix this with the script? Im trying to extract a large amount of files and for it to skip extracting dups which have already been extracted. But if it adds the "part1" then it will create it in a whole new folder and not see it as a dup. Thanks
     
    bobsagetfullhou, Mar 14, 2017
    #11
  12. Michael Win User
    If your RARs are fewer than 10 parts (numbered part1, part2, ... as opposed to part01, part02; or part001, part002), you can add:
    Code: -Exclude *part[2-9].rar[/quote] As in:
    Code: Get-ChildItem Z:\YourDir -Include *.zip, *.rar -Exclude *part[2-9].rar -Recurse | ForEach-Object {& "C:\Program Files\WinRAR\WinRAR.exe" x $_.FullName ($_.DirectoryName+'\'+$_.BaseName+'\'); Wait-Process WinRAR}[/quote] If you have any RARs with more than 9 parts, it'll be a bit more complicated.
     
    Michael, Mar 14, 2017
    #12
  13. Pyprohly Win User

    Issue when extracting multiple files within different folders at once

    Use regex to remove the ‘part#’ part.

    Code: Get-ChildItem 'Z:\YourDir' -Include *.zip, *.rar -Recurse | ForEach-Object {& 'C:\Program Files\WinRAR\WinRAR.exe' x $_.FullName "$($_.DirectoryName)\$($_.BaseName -replace '\.part\d*$')\"; Wait-Process WinRAR}[/quote]
     
    Pyprohly, Mar 15, 2017
    #13
  14. Works, thanks all for your help.
     
    bobsagetfullhou, Apr 4, 2018
    #14
Thema:

Issue when extracting multiple files within different folders at once

Loading...
  1. Issue when extracting multiple files within different folders at once - Similar Threads - Issue extracting multiple

  2. Command to view all files within a group of folders all at once

    in Windows 10 Gaming
    Command to view all files within a group of folders all at once: I used to use a sort command when trying to view all files across a bunch of folders at once. It makes sorting files easier. I do know part of the command was written as not sort kind, I may even have the word order off slightly however I am unable to remember which parts...
  3. Command to view all files within a group of folders all at once

    in Windows 10 Software and Apps
    Command to view all files within a group of folders all at once: I used to use a sort command when trying to view all files across a bunch of folders at once. It makes sorting files easier. I do know part of the command was written as not sort kind, I may even have the word order off slightly however I am unable to remember which parts...
  4. Rename multiple files at once

    in Windows 10 Software and Apps
    Rename multiple files at once: Greetings,I have the following situation:I need to rename a lot really a lot of files, that were named without using any standard. So, I am doing this manually, but it is taking too much time. So, I would like to know if there is any tool that I could use to help me on...
  5. Rename multiple files at once

    in Windows 10 Network and Sharing
    Rename multiple files at once: Greetings,I have the following situation:I need to rename a lot really a lot of files, that were named without using any standard. So, I am doing this manually, but it is taking too much time. So, I would like to know if there is any tool that I could use to help me on...
  6. Rename multiple files at once

    in Windows 10 Gaming
    Rename multiple files at once: Greetings,I have the following situation:I need to rename a lot really a lot of files, that were named without using any standard. So, I am doing this manually, but it is taking too much time. So, I would like to know if there is any tool that I could use to help me on...
  7. Renaming multiple files at once.

    in Windows 10 Customization
    Renaming multiple files at once.: Hi Team,Is there a way to change the format in which multiple renaming is done?For example if i select 3 files and hit rename, currently it does them like this:"xx 1.yy""xx 2.yy""xx 3.yy"In my daily work it would help a lot if instead the renaming would be done like...
  8. Renaming multiple files at once.

    in Windows 10 Gaming
    Renaming multiple files at once.: Hi Team,Is there a way to change the format in which multiple renaming is done?For example if i select 3 files and hit rename, currently it does them like this:"xx 1.yy""xx 2.yy""xx 3.yy"In my daily work it would help a lot if instead the renaming would be done like...
  9. Renaming multiple files at once.

    in Windows 10 Software and Apps
    Renaming multiple files at once.: Hi Team,Is there a way to change the format in which multiple renaming is done?For example if i select 3 files and hit rename, currently it does them like this:"xx 1.yy""xx 2.yy""xx 3.yy"In my daily work it would help a lot if instead the renaming would be done like...
  10. Files within Folder

    in Windows 10 Network and Sharing
    Files within Folder: When transferring numbered files into a folder they were entered out of sequence. It there a way to move the files into sequence? https://answers.microsoft.com/en-us/windows/forum/all/files-within-folder/7a31db01-f717-4311-b6da-5c631a22b3c6"

Users found this page by searching for:

  1. extracting multiple files in folders windows 10