Batch files 3: How to sort and move files by extension type

Batch files 3: How to sort and move files by extension type


Batch files 3: How to sort and move files by extension type

Is your desktop overcrowded with random files? Or maybe your downloads folder? Want to clean it up, fast? Using a batch file you can automatically move files to the appropriate folder.

Batch file commands:

"@echo off

REM Documents
move *.docx C:\Users\username\Documents
move *.pdf C:\Users\username\Documents
move *.xls C:\Users\username\Documents
move *.txt C:\Users\username\Documents

REM Music
move *.mp3 C:\Users\username\Music
move *.wav C:\Users\username\Music

REM Pictures
Move *.jpg C:\Users\username\Pictures
Move *.jpeg C:\Users\username\Pictures
Move *.png C:\Users\username\Pictures
Move *.bmp C:\Users\username\Pictures
Move *.gif C:\Users\username\Pictures

REM Video
move *.mp4 C:\Users\username\Videos
move *.wmv C:\Users\username\Videos
move *.avi C:\Users\username\Videos
move *.mkv C:\Users\username\Videos"

Remember to change 'username' to your actual computer username.
´REM´ means 'REMARK', so everything on the same line after that command gets ignored. In this case I used it as a header for the list of extension types.


Follow me on other media:
►Website: http://www.guidoshowtos.com
►Facebook: https://www.facebook.com/guidoshowtos
►Twitter: https://twitter.com/guidoshowtos
►Google+: https://plus.google.com/+Guidoshowtos


Music used:
Pulse Rock, Kevin MacLeod (incompetech.com)


Annotations;

Batch files 3: Sort and move files by extension type

Does your desktop look something like this? Or maybe your download folder? Want to clean it up fast and sort the files automatically from now on?

You can do so with a simple batch file.
Right click the desktop → New → Text Document.
I name my text file 'Sort Files'.

You can copy and paste the batch file commands from the description below this video.

These batch file commands tell your computer to move all files ending on their respective extension (e.g. *.docx) to a specific filepath (in this case your libraries (documents, music, pictures, video's).

Usually you'll want your .docx, pdf, and xls files in your documents folder, your .jpg, .png files in your pictures folder, etc.
You can, of course, add more extensions to this file.

Save the text document and close it. Rightclick → Rename, and change the extension to a .bat to make the text file into a batch file.
(if you can't change the extension this way, go to Folder Options → View, and untick 'Hide extension for known file types')

Click 'Yes'

Now, by doubleclicking the batch file, we can move all files on the desktop to their respective libraries.

Wham!

All documents in the documents folder...

... all music in the music folder ...

... all silly animal pictures in the pictures folder...

... and the video in the video folder!

Video Length: 01:35
Uploaded By: Guido's How-to's
Published: 4/16/2014
View Count: 24,511

Related Software Products
Extension Copy
Extension Copy

Published By:
zysoftsupport

Description:
Extension Copy is a powerful tool designed to help you copy, delete, cut or crush the files with specific name, size and modification time. This tool supports filename masks, so it allows you to manage the file names and types in which you're interested. With extension copy, you can copy or cut interested files, or delete them in one action. There are 3 deleting-modes, move to trash, delete and crush. If you have confidential documents and want these documents to be erased forever, you can ...


Related Videos
Download MEGA files directly through IDM(internet download manager) UPDATED #RGS
Download MEGA files directly through IDM(internet download manager) UPDATED #RGS

Video Length: 02:11
Uploaded By: Gnana Sreekar (12/18/2015)
View Count: 105,592

How to install an extension in Magento - Magento Video Tutorials from Opace
How to install an extension in Magento - Magento Video Tutorials from Opace

Video Length: 02:29
Uploaded By: Opace Web Design in Birmingham (3/30/2012)
View Count: 55,967

Tutorial Kembalikan IDM Extension Ke Dalam Chrome 2013
Tutorial Kembalikan IDM Extension Ke Dalam Chrome 2013

Video Length: 05:29
Uploaded By: Adli Shinichi (7/26/2013)
View Count: 40,433

Creating a new user and extension in Avaya IP Office by copying and pasting an existing user
Creating a new user and extension in Avaya IP Office by copying and pasting an existing user

Video Length: 02:58
Uploaded By: Digitcom (3/11/2014)
View Count: 36,882

Maya 2016 Extension 1: Improved Vector Graphics Workflow
Maya 2016 Extension 1: Improved Vector Graphics Workflow

Video Length: 07:16
Uploaded By: Autodesk (8/11/2015)
View Count: 19,023

Copyright © 2026, Ivertech. All rights reserved.