move files by type cmd command prompt windows 10 for in easy tutorial subfolders search

How to Move Files by Type with a Simple Command on Windows 10

Published by Soufiane Sabiri | Categories : Computers - Tips & Tricks - Computers - Windows 10

Are you struggling to organize all your work/study/hobby documents/videos/images?

Do you want to group them all by file types in one location?

Almost all of us have a mixture of files in our PCs, sometimes we want to separate the videos from the Word documents and other files, but it’s time-consuming especially when you have multiple subfolders and the list goes on.

In this practical tutorial, you will learn how to move files by type to a specific location.

We will be using the Command Prompt for this practice if you have any other methods or questions feel free to leave a comment below.

Let’s dive in!

1. The Simple Command to Move Files by Type

If you want to move the files that are placed in a single folder by type then use this command: move *.ext C:\destination, here are some examples.

cd D:\Downloads
move *.docx %userprofile%\Documents
move *.png %userprofile%\Pictures
move *.mp4 %userprofile%\Videos
move files by type cmd command prompt windows 10 for in 1 userprofile documents

The downside of this command is that it doesn’t take subfolders into account. Use the 2nd command with for and /r to reach all files in subfolders…

2. The Best Command to Move All Files by Type

If your files are placed everywhere, in subfolders and subsubfolders and subsubsubsub…folders, then this command will do the trick.

Replace the following in the command with the appropriate extension.

  • SOURCE_DIR: Change this to your source directory, the folder where your files are at.
  • TARGET_DIR: This is the destination folder, change it.
FOR /R "C:\SOURCE_DIR" %i IN (*.pdf) DO MOVE "%i" "C:\TARGET_DIR"
move files by type cmd command prompt windows 10 for in 2 for r do move pdf

There you have it, you just learned how to move files by type using a single command line.

If you have any questions I am here to help ;)

Thanks for reading and don’t forget to share.


Related tutorials:


Author: Soufiane Sabiri

Soufiane is a young computer scientist and specialist in web design, knows a lot of things in the computer world. This enthusiast enjoys helping people innovate and learn more about the IT world...

Be the first to leave a comment !

Leave a comment

xD oO ^_^ =] =) ;-( ;) :| :woot: :whistle: :sleep: :sick: :police: :p :o :ninja: :mm: :love: :lol: :kiss: :hmm: :evil: :bandit: :angel: :alien: :D :) :( 8)