Forum Discussion

TenOC's avatar
TenOC
Nomad
Nov 06, 2022

Move all files with .txt anywhere inside current folder

Windows 10 on laptop

My data hard drive F: is a mess with more than 200 folders plus an unknown number of subfolders. I would like to move all files with .txt extension present anywhere inside the current folder such as "F:\2001" (even in subfolders) to the main F: "root" no folder.

I can then review them and delete the ones I do not need.

In the days of DOS I THINK there was a way. I have tried DOS "move" and "Xmove" commands with no joy.

A software program that would do this would be welcome
  • wnjj's avatar
    wnjj
    Explorer II
    How about this (while sitting at F:\)?

    move *\*.txt .
    move *\*\*.txt .
    move *\*\*\*.txt .

    Do that to sufficient depth until it doesn’t find any files to move. This is something I’ve done on Linux but I think ‘.’ also works in cmd prompt for the destination. If not, use ‘F:\’
  • I found a free software package "File Fisher" that I think will work. Trying it now.
  • WIN10 has everything you need to do this built-in.

    Start Powershell (right-click Start icon), and use the command:
      PS F:\> Get-ChildItem -Path ".\*.txt" -Recurse | Move-Item -Destination "F:\TextFiles"

    This should move all .txt extension files in your F: directory, and all sub-directories to whatever directory (folder) you specify such as 'TextFiles'.
  • Have you tried using the built in "file explorer"

    Open file explorer, go to a folder that may have text, and in the search box type *.txt.

    Right click and then up pops a box allowing you to cut, copy, etc.
    I would not do a cut and past because it is too risky.
    Using Copy and Paste you can build a copy into the root directory as you are attempting.

    I would need to play around but with subdirectories you can usually move files up into directories above with ease.
  • wa8yxm's avatar
    wa8yxm
    Explorer III
    Last I knew there was a limit to the number of files in ROOT (C:\)

    Id set up a folder Text, then copy into that

    Now.. I do not know if your text files are scattered over multiple folders
    But for each folder in Dos.
    From within the TEXT folder
    Copy C:\ the full path to the folder *.txt
    Then once you have verified the files copied
    Go to the folder and del *.txt

    I do not know if you can do it with a recursive command (All folders at once)

    In windows
    Open two file manager windows
    Point one to c:\text

    In the other do a search on .txt
    Then copy (not sure this will work I really do not like Windoze)

About RV Must Haves

Have a product you cannot live without? Share it with the community!8,793 PostsLatest Activity: Aug 22, 2023