How to Easily Sort Files by Extension into Separate Folder?
For example you have hundreds of files of various file formats in one folder and you want to categorize them. This scenario can be especially applicable if you want to separate your video and image files by type. You would probably open the Folder and sort by types.
You can do the same by the following steps:
1. Open the folder in which are the files you want to order.
2. Right click on a blank point
3. Click on “Sort by”
4. Click on “Extension”
Then you create a folder for each type and separate them , but if there are dozens of different file formats , this process will be difficult. Fortunately, we have a script that you can do this Job with one click. Follow these steps:
Via .bat file Sort Files by Extension into Separate Folder
1. Open Notepad on your computer and Paste the following code.
@echo off for %%a in (".\*") do ( if "%%~xa" NEQ "" if "%%~dpxa" NEQ "%~dpx0" ( if not exist "%%~xa" mkdir "%%~xa" move "%%a" "%%~dpa%%~xa\" ) )
2. Click on File – Save As then Select a path where you want to save
3. Give an name and Click the Save button.
4. Put the bat file you created into the folder you want to separate according to its types and run it.
You will see some sub-folders according to the file extensions. There are some advantages of doing so for example if you want to delete exe files, you can delete the corresponding folder. Similarly, if you want to check the video files, you can open the Mp4 , Mkv or Avi folder.