Windows 10: How extract files from nested folders - is there an app?

  1.    10 Feb 2018 #1

    How extract files from nested folders - is there an app?


    I have one primary folder and, under it, are nested folders - perhaps 3 to 5 deep. Is there an easy way to extract the files so that I end up with the primary folder and no subfolders - just all the files?
      My ComputerSystem Spec

  2.    10 Feb 2018 #2

    If it's a one-time thing you can go to the primary folder and enter "*" in the search box. That will bring up all the files and folders under the primary. Then you can select just the files and cut+paste them.

    If you need to do this regularly then you can write a batch file/script. Something like
    Code:
    C:\temp>cd primary
    
    C:\temp\primary>for /f "tokens=*" %X in ('dir /b /s /a:d') do copy "%X" .
    (adapted from for /d - Loop through directory - Windows CMD - SS64.com )
      My ComputerSystem Spec


  3. Posts : 461
    Windows 10 Home x64 and Pro x86
       10 Feb 2018 #3

    Nisko,

    I use this batch file. I call it FlatFileCopierToDesktop.bat but you can call it whatever you want.

    Code:
    :: Put this batch file in the highest level folder of the set you want to work through, it will copy all the files to a folder of your choice
    :: Put in your chosen target folder in place of my D:\Desktop\FlatFileCopies.  Choosing a target folder that the batch file has to make is merely how I use this - you could use an existing folder and ditch the line beginning md ...
    :: If you want only certain files, replace (*) with (*.txt) or similar
    Set TargetFolder=D:\Desktop\FlatFileCopies
    md "%TargetFolder%" 
    for /r %%d in (*) do copy "%%d" "%TargetFolder%"
    Pause to check afterwards
    Denis
      My ComputerSystem Spec

  4.    11 Feb 2018 #4

    Any file manager/exploer with the ability to do a recursive search, that is, explore the files in nested folders, should achieve your goal.

    I personally use XNView, installed, for the right-click context menu recursive (show all files) search. Select all, drag-and-drop to another folder or to the parent folder. There is a portable zip version for a one-time use.
      My ComputerSystem Spec

  5.    11 Feb 2018 #5

    All these solutions are great - thank you very much.


    I tried the first one (use an "*") and it seems to have worked for what I want it for. I'd like to try the others too - but I don't know how to use or insert batch files. By tomorrow, I intend to reply to those posts that require code. If you're willing to guide me a little, I'd like to learn. Thank you!
      My ComputerSystem Spec


  6. Posts : 461
    Windows 10 Home x64 and Pro x86
       12 Feb 2018 #6

    I started learning about batch files by reading this guide - The Command Line in Windows Batch file basics

    I then moved on to Rob van der Woude's guides and examples - Batch files - RobvdW

    But if you are going to sit down and systematically study something, consider studying Powershell instead - it is a structured set of commands & MS regard it as supplanting command window commands & batch files.
    Start with PowerShell Scripting - The Basics - TenForums,
    then PowerShell Scripting - Run a Script from Shortcut - TenForums
    After that, I am not at all sure which one to recommend. You could try downloading & studying Getting Started with PowerShell - Shepard

    Denis
      My ComputerSystem Spec


  7. Posts : 577
    Windows 10 Home x64 Version 1709 (OS Build 16299.371)
       12 Feb 2018 #7

    Another good place to poke around is https://technet.microsoft.com/en-us/...or=-2147217396
      My ComputersSystem Spec

  •    13 Feb 2018 #8

    Thanks, folks, for the guidance.
      My ComputerSystem Spec


  •  

    Related Threads
    This is the major gripe I have with Edge right now - no nested folders like Firefox or IE. OK, you can nest folders sort of, but instead of showing the folder contents in situ when you click on the sub folder, you get a side menu that pops out on...
    How to Add Extract All to Context Menu of MSI files in Windows 10 A Microsoft Windows installer package (.msi) file is a storage file containing the instructions and data required to install an application. This tutorial will show you how to...
    There is a Windows 7 tutorial called Extract Files from Windows 7 Installation DVD and it works great. I need to extract files from a Windows 10 Installation DVD and did not find a tutorial so thought to follow the same process as the Windows 7...
    IF I have a backup image of all my files from Windows 10 on a DVD disk backup, and I wish to extract (using 7-zip) those files to original FOLDER destinations, but I have already re-installed a clean install of Windows 10 program, how do I...
    I do not have windows 10 (yet) so I can't test this out. I developed software that needs to be extracted. The folder that is extracted has another folder in it along with a Flash player. The Flash player needs to remain in the folder along with the...
    Our Sites
    Site Links
    About Us
    Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 17:16.
    Find Us