Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 10479

Batch script to re-size .jpg in music folder to 350x350 & delete unwanted files

$
0
0

Any wizards out there that can help with this?LO-OL I know you're out there, you've helped me before.

I currently use a script to re-name music folders from eg. Taylor Swift - 1989 to a new folder Taylor Swift with a subfolder 1989 with all files moved into it.

I've also added a rename line to change the the .jpg file to be renamed Folder which works a treat.I'd like to know if it's possible to resize/scale that .jpg file to a smaller size of 350x350 instead of me doing it through the old Microsoft Office 2010 picture program.

Lastly, I can't work out how to delete unwanted files, these being .log, .txt, .info

If I could get this all on the same batch script, that would be amazing.

This is what I currently use :

@echo off & cd /d "%~dp0"for /f delims^= %%i in =;(' dir /a:-a /b "* - *"');= do for /f usebackq^tokens^=1*delims^=-^" %%G in =;(`         set /p "'=%%~nxi"^<nul `);= do call %:^) "%%~G" "%%~H" "%%~dpnxi"for /r /d %%i in (*)do if exist "%%~fi\*.jpg" for /f tokens^=* %%I in ('%__APPDIR__%where.exe "%%~i:*.jpg"')do ren "%%~fI" "Folder.jpg"%:^)if not "%~1" == "" =;(     set "_dir=%~1" & set "_sub=%~2"     call rename "%~3" "%%_sub:~1%%"     call mkdir "%cd%\%%_dir:~0,-1%%"     call move "%%_sub:~1%%" "%%_dir:~0,-1%%"      );= & exit /b 

Viewing all articles
Browse latest Browse all 10479

Trending Articles