# How to decrease the tagsize after deleting coverart

**URL:** https://community.mp3tag.de/t/how-to-decrease-the-tagsize-after-deleting-coverart/8891
**Category:** General Discussion
**Created:** [September 4, 2009, 1:41pm UTC](https://community.mp3tag.de/t/how-to-decrease-the-tagsize-after-deleting-coverart/8891 "2009-09-04T13:41:38Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [January 6, 2014, 9:57pm UTC](https://community.mp3tag.de/t/how-to-decrease-the-tagsize-after-deleting-coverart/8891/5 "2014-01-06T21:57:02Z")

</div>

> [@Lupercus](#):
>
> ... Is there any way decrease the tagsize ? ...

I'm so free and hijack this thread about the padding size in FLAC files, and want to give thanks to Lupercus for his batch file using the commandline tool "metaflac.exe", which I have used as a template.  
I wrote an extended version of the batch file, see attachment.

 @ **ECHO** OFF

_REM ================================================================================  
REM Purpose: Change the padding size within all FLAC files in the given folder .  
REM The given folder path name can be dropped onto this batch file ...  
REM ... or can be set as the first parameter on the command line.  
REM This CMD script is an extended version of the CMD script from Mp3tag user "Lupercus, Sep 5 2009, 13:52" .  
REM Detlev Dalitz.20140106.  
REM ================================================================================  
REM Define the fully qualified path to the file "metaflac.exe"._  
**SET** METAFLAC="P:\Programs\FLAC\metaflac.exe"  
_REM Define the padding default size in Bytes.  
REM The pad size is allowed to be an integer value in the range from 0 to 16777215._  
**SET** PADSIZE\_DEFAULT=2000  
_REM ================================================================================_  
**ECHO**.[**%~n**]  
**ECHO**.  
**ECHO**.Set padding for all FLAC files in the current folder ...  
**CD** /D " **%~f1**"  
**ECHO**." **%CD%**"  
**IF NOT EXIST**"_.FLAC" (  
 **ECHO**.  
 **ECHO**.FLAC files not found.  
 **GOTO** END  
)  
:GET\_PADSIZE  
 **ECHO**.  
 **SET** PADSIZE\_INPUT= **%PADSIZE\_DEFAULT%**  
 **SET** /P PADSIZE\_INPUT=Give padding size in Bytes (default **%PADSIZE\_DEFAULT%** ):  
 **SET** /A PADSIZE\_EVAL=1_ **%PADSIZE\_INPUT%**  
**IF**  **%PADSIZE\_EVAL%** NEQ **%PADSIZE\_INPUT%** (  
**ECHO**.Enter an integer number in the range ...  
**ECHO**.decimal ...: from 0 to 16777215  
**ECHO**.hexadecimal: from 0 to 0xffffff  
**ECHO**.octal .....: from 00 to 077777777  
**GOTO** GET\_PADSIZE  
)  
**ECHO**.Set padding to **%PADSIZE\_EVAL%** Bytes.  
**ECHO**.  
**ECHO**.Press [Enter] to continue or [Ctrl+C] to exit.  
**PAUSE** \>**NUL  
ECHO**.  
**SET** COUNT=0  
**FOR**  **%%f**  **IN** ("\*.FLAC") **DO** (  
 _REM ATTRIB -R "%%~nxf"  
REM ECHO."%%~nxf"  
REM ECHO.%%~ftzaf_  
**SET** /A COUNT= **!COUNT!** +1  
**ECHO**.  
**ECHO**. **!COUNT!** :  
**ECHO**.Remove padding from ...  
**DIR** /N/4 " **%%f**"|FIND " **%%f**"  
**%METAFLAC%** --dont-use-padding --remove --block-type=PADDING " **%%~nxf**"  
**IF ERRORLEVEL** 1 **GOTO** ERROR  
**ECHO**.Add padding **%PADSIZE\_EVAL%** Bytes ...  
**%METAFLAC%** --add-padding= **%PADSIZE\_EVAL%**" **%%~nxf**"  
**IF ERRORLEVEL** 1 **GOTO** ERROR  
**DIR** /N/4 " **%%f**"|FIND " **%%f**"  
**ECHO**.  
 _REM PAUSE_

 ) 

**ECHO**.  
**ECHO**.Ready.  
**GOTO** END  
:ERROR  
**ECHO**.  
**ECHO**.Error on reducing padding ... batch process stopped.

 :END 

**ECHO**.  
**PAUSE  
EXIT**

 

[MetaFlac.SetPadding.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/0/001316eb51b40bbecdf51a4cb199c5e1d9ededa3.txt) (2.25 KB)  
For usage remove the extension ".txt" from the filename.

DD.20140106.2356.CET

Note:  
This cmd script makes use of "delayed variable expansion".  
To use delayed variable expansion it must be enabled.

This can be done using CMD /V:ON /C to start the batch file, ...  
or better insert the code line ...  
SETLOCAL ENABLEDELAYEDEXPANSION  
... inside the batch file.

To make it permanently ...  
Windows Registry Editor Version 5.00  
[HKEY\_CURRENT\_USER\Software\Microsoft\Command Processor]  
"DelayedExpansion"=dword:00000001

DD.20150515.1120.CEST

[MetaFlac.SetPadding.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/0/001316eb51b40bbecdf51a4cb199c5e1d9ededa3.txt) (2.25 KB)

---

_[View the full topic](https://community.mp3tag.de/t/how-to-decrease-the-tagsize-after-deleting-coverart/8891)._
