Bulk MKV Metadata Removal - Batch Scipt

3

I am trying to create a batch file that will use mkvpropedit and remove all tags from all mkv files within a directory, I have so far managed to get this:

@ECHO OFF
TITLE MKV Metadata Remover
ECHO.
ECHO This program executes MKVPropedit to remove all metadata from all mkv 
files in the current directory.
ECHO.

:choice
set /P c=Are you sure you want to continue[Y/N]?
if /I "%c%" EQU "Y" goto :somewhere
if /I "%c%" EQU "N" goto :somewhere_else
goto :choice


:somewhere

FOR /F "tokens=*" %G IN ('dir /b *.mkv') DO mkvpropedit "%G" --tags all: -d 
title --delete-attachment "1" 
pause 
exit

:somewhere_else

ECHO Closing program...
pause
exit

However, when using the Y option the window just closes - even in a directory full of .mkv files.

Any help would be greatly appreciated, thanks for reading.

Connor

Posted 2017-08-31T10:35:58.903

Reputation: 31

Answers

1

Try like this:

FOR %%G IN (*.mkv) DO mkvpropedit "%%G" --tags all: -d title --delete-attachment 1

Note: double % are needed for variables inside batch files (see: https://stackoverflow.com/questions/14509652/what-is-the-difference-between-and-in-a-cmd-file)

skazi

Posted 2017-08-31T10:35:58.903

Reputation: 61