Created
March 4, 2026 07:04
-
-
Save GalaxySH/dedd4cec221d18c9cbeb370024df0dd7 to your computer and use it in GitHub Desktop.
Organize (downloaded) files into folders designated by their extension (2018-04-27)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| rem For each file in your folder | |
| for %%a in (".\*") do ( | |
| rem check if the file has an extension and if it is not our script | |
| if "%%~xa" NEQ "" if "%%~dpxa" NEQ "%~dpx0" ( | |
| rem check if extension folder exists, if not it is created | |
| if not exist "%%~xa" mkdir "%%~xa" | |
| rem Move the file to directory | |
| move "%%a" "%%~dpa%%~xa\" | |
| )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment