It's the right forum. Easy as pie, buddy.
Code: Select all
@echo off&echo:&color B&title Make folder, move and rename PNGs by orange_batch
for %%x in ("C:\...\Target Folder\*.png") do (
md "%%~dpnx"
move "%%x" "%%~dpnx"
ren "%%~dpnx\%%~nxx" icon.png
echo: ^> Made folder: "%%~nx" Moved: "%%~nxx" Renamed to: "icon.png"
echo:
)
echo: Press any key to exit.
pause>nul
exit
An explanation:
"for" loops through whatever it accepts for input (default and switches /d /r, /l, /f). If you type "for /?" in the command line, it tells you about "optional syntax" which lets you expand it's (temporary local) variable to specific information. It works on arguments as well, but not regular variables.
For every .png in the target folder, loop through the code block and expand %%x to it's location.
Code: Select all
for %%x in ("C:\...\Target Folder\*.png")
Make directory "Drive:\Path\Current File's Name"
Move current file to "Drive:\Path\Current File's Name"
Rename "Drive:\Path\Current File's Name\Current File's Name & Extension" to icon.png