I have already solved my question... What I haven't solved is how to do this if the .bat
file is located in a parent folder and that it should work on all subfolders?
Right now, there's a limitation that it only create folders if the .bat
file is located in the same folder as the files. It can't create folders if the files are inside a subfolder.
What I have is:
the filename of this .bat
is :
organize.bat
@echo off
for %%i in (*) do (
if not "%%~ni" == "organize" (
md "%%~ni" && move "%%~i" "%%~ni"
)
)
How I do it right now:
- I place the
.bat
file in a folder together with the files - When I click it, it will create folders with a name based on the files inside that folder
- It will also move each files in those folders of the same name
What I need:
- Place the
.bat
file in the main folder with many subfolders containing the files - Click it to perform the same tasks above
Apologies if my explanation is confusing... I hope it's still understandable.
Thank you in advance!