# Export 1 .NFO per .MKV file for KODI, Help needed

**URL:** https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416
**Category:** Support
**Created:** [December 27, 2025, 9:07am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416 "2025-12-27T09:07:52Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 27, 2025, 9:07am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/1 "2025-12-27T09:07:52Z")

</div>

Hi my first post, thanks for this great piece of software =)

I am hoping I’m making my self clear to what I want.

I know of other threads but I just can’t figure it out.

basically I want some basic metadata from my files exported to 1 separate NFO file for all musicvideos in a folder for KODI

So this is what i got, this script works fine to export a single NFO for kodi.

```auto
$filename(%_filename%.nfo)<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
<title>%title%</title>
   <artist>%albumartist%</artist>
   <album>%album%</album>
   <genre>%genre%</genre>
   <year>%year%</year>
<actor>
        <name>%artist%</name>
        <role></role>
        <thumb></thumb>
        <order>1</order>
</actor>
    </movie>

```

But it only works for single files.

If I use this script and extract from multiple files I get a single NFO with information of all the files.

```auto
$filename(%_filename%.nfo)$loop(%_path%)<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
<title>%title%</title>
   <artist>%albumartist%</artist>
   <album>%album%</album>
   <genre>%genre%</genre>
   <year>%year%</year>
<actor>
        <name>%artist%</name>
        <role></role>
        <thumb></thumb>
        <order>1</order>
</actor>
    </movie>
$loopend()

```

So how could I split this file to separate files.

I am ofcourse missing something here and I would really appreciate some assistance..

THX, cheers from Sweden.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 27, 2025, 9:14am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/3 "2025-12-27T09:14:48Z")

</div>

See this thread on how to split a single text file into several ones using a .bat file:

> [@Feature Request: Batch Export Lyrics into Individual Files (.txt / .lrc)](https://community.mp3tag.de/t/feature-request-batch-export-lyrics-into-individual-files-txt-lrc/57158/2):
>
> Here is a suggestion how to combine an export script and distribute the resulting output to several files, in this case a playlist. The secret lies in the command shell batch file that sends text to names files:

---

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 27, 2025, 9:44am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/4 "2025-12-27T09:44:54Z")

</div>

Thanks alot !

Very long thread, I will dig in and see if I can get something out of it. Seems most of it is about lyrics.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 27, 2025, 9:52am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/5 "2025-12-27T09:52:53Z")

</div>

the techniques stays the same. Instead of  
`$filename(%_filename%.nfo)`  
set  
`$filename(Infobatch.bat)`  
Then let the export script create a (text) batch file first that contains statements like instead of an e.g. simple  
`<title>%title%</title>`  
you set  
`echo "<title>%title%</title>">> %_filename%.nfo`  
(repeat that for each line of code)  
After the execution of the export script you get into the file system, search for `infobatch.bat` and execute that batch file.  
It should create a number of .nfo files, one for every given filename.

It may be necessary to escape characters with special functions when they appear as part of the data

---

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 28, 2025, 8:34am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/6 "2025-12-28T08:34:32Z")

</div>

Hi THX again for your post and quick answear.

I’m sorry but I still don’t get it. Must be retarded i guess.

So to create this `infobatch.bat` file, I should mark a couple of files, click CTRL+E to export?

and in that file I should take this very short example:

```auto
$filename(Infobatch.bat)
echo "<title>%title%</title>">> %_filename%.nfo

```

 ![Skärmbild 2025-12-28 092809](https://community.mp3tag.de/uploads/default/original/3X/1/b/1b3279fb9d06bab18b29ad1dd805508dc8a1a320.png)

the resulting infobatch.bat:

```auto
#EXTM3U echo #EXTINF:206,Artist aaa - aaa title >> split_0.nfo echo 01 AAA.mkv >> split_0.nfo echo #EXTINF:200,Artist bbb - bbb title >> split_0.nfo echo 02 BBB.mkv >> split_0.nfo echo #EXTINF:332,Artist ccc - ccc title >> split_0.nfo echo 03 CCC.mkv >> split_0.nfo 

```

when I run the infobatch.bat file it gives me a file called “split\_0.nfo” and that file is empty.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 28, 2025, 8:43am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/7 "2025-12-28T08:43:29Z")

</div>

Where does the

> [@user318](#):
>
> `#EXTM3U`

come from? That is a typical keyword in a playlist.

To outline the basic procedure:  
The export creates a batch file.  
The batch file contains the commands to put the xml.statements into a specified .nfo file.  
The first line in the export code should end in `>%_filename%.nfo` (to initally create the nfo-file) while all further lines end in `>>%_filename%.nfo` (to add further lines to the nfo-file)

You keep all the lines from your original export script only that you preceed every line with `echo "` and end it as described above.

---

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 28, 2025, 9:08am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/8 "2025-12-28T09:08:05Z")

</div>

> [@ohrenkino](#):
>
> Where does the
> 
> > [@user318](#):
> >
> > `#EXTM3U`
> 
> come from?

I have no clue

so I take it the exportfile, short version could look like this?

```auto
$filename(Infobatch.bat)>%_filename%.nfo
echo "<title>%title%</title>">> %_filename%.nfo
echo "<artist>%artist%</artist>">> %_filename%.nfo

```

I mark the 3 files frpm my screenshot and export with that..

resulting Infobatch.bat:

```auto
>01 AAA.nfo
echo "<title>aaa title</title>">> 01 AAA.nfo
echo "<artist>Artist aaa</artist>">> 01 AAA.nfo

```

when I run the bat file I get one single file called 01 with no extension. it says

edit, this is the resulting 01 file

```auto
"<title>aaa title</title>" AAA.nfo
"<artist>Artist aaa</artist>"

```

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 28, 2025, 1:43pm UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/9 "2025-12-28T13:43:15Z")

</div>

You are following good ole command shell syntax. This means that you have to experiment a little to get a proper filename for the echo command.

```auto
$filename(Infobatch.bat,utf-8)
echo "<title>%title%</title>" > "%_filename%.nfo"
echo "<artist>%artist%</artist>" >> "%_filename%.nfo"

```

creates a batch file that in return produces the .nfo-file.

... it has the inverted commas, though.

---

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 28, 2025, 6:41pm UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/10 "2025-12-28T18:41:26Z")

</div>

Thanks again!

It’s getting closer 😀

```auto
$filename(Infobatch.bat)$loop(%_path%)
echo "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" >>"%_filename%.nfo"
echo "<movie>" >>"%_filename%.nfo"
echo "<artist>%albumartist%</artist>" >> "%_filename%.nfo"
echo "<title>%title%</title>" >> "%_filename%.nfo"
echo "<album>%album%</album>" >>"%_filename%.nfo"
echo "<genre>%genre%</genre>" >>"%_filename%.nfo"
echo "<year>%year%</year>" >>"%_filename%.nfo"
echo "<track></track>" >>"%_filename%.nfo"
echo "<plot></plot>" >>"%_filename%.nfo"
echo "<director></director>" >>"%_filename%.nfo"
echo "<actor>" >>"%_filename%.nfo"
echo "<name>%artist%</name>" >>"%_filename%.nfo"
echo "<role></role>" >>"%_filename%.nfo"
echo "<thumb></thumb>" >>"%_filename%.nfo"
echo "<order>1</order>" >>"%_filename%.nfo"
echo "</actor>" >>"%_filename%.nfo"
echo "</movie>" >>"%_filename%.nfo"
$loopend()

```

If I export these lines. I get all 3 NFOs named same as the MKVs.

here is the first one:

```auto
"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" 
"<movie>" 
"<artist>albumartist aaa</artist>" 
"<title>aaa title</title>" 
"<album>aaa album</album>" 
"<genre></genre>" 
"<year>2025</year>" 
"<track></track>" 
"<plot></plot>" 
"<director></director>" 
"<actor>" 
"<name>Artist aaa</name>" 
"<role></role>" 
"<thumb></thumb>" 
"<order>1</order>" 
"</actor>" 
"</movie>" 

```

which is correct exept the " symbols between every line in the NFO. I used Notepad++ to remove them and KODI scanned the musicvideos just fine.

Any idea for solution here?

If not, I guess I can live with having one extra step to remove the markers, symbols whatever they are called. .

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 28, 2025, 7:54pm UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/11 "2025-12-28T19:54:18Z")

</div>

You can try to "escape" the `<` and `>` and `?` characters with a `^` like this:

```auto
echo ^<^?xml version="1.0" encoding="UTF-8" standalone="yes"^?^> >>"%_filename%.nfo"
echo ^<movie^> >>"%_filename%.nfo"

```

Remove the quotation marks " around the XML start- and end-tags:  
OLD: `echo "<movie>"`  
NEW: `echo ^<movie^>`

This version should work:

```auto
$filename(Infobatch.bat)$loop(%_path%)
echo ^<^?xml version="1.0" encoding="UTF-8" standalone="yes"^?^> >"%_filename%.nfo"
echo ^<movie^> >>"%_filename%.nfo"
echo ^<artist^>%albumartist%^</artist^> >> "%_filename%.nfo"
echo ^<title^>%title%^</title^> >> "%_filename%.nfo"
echo ^<album^>%album%^</album^> >>"%_filename%.nfo"
echo ^<genre^>%genre%^</genre^> >>"%_filename%.nfo"
echo ^<year^>%year%^</year^> >>"%_filename%.nfo"
echo ^<track^>^</track^> >>"%_filename%.nfo"
echo ^<plot^>^</plot^> >>"%_filename%.nfo"
echo ^<director^>^</director^> >>"%_filename%.nfo"
echo ^<actor^> >>"%_filename%.nfo"
echo ^<name^>%artist%^</name^> >>"%_filename%.nfo"
echo ^<role^>^</role^> >>"%_filename%.nfo"
echo ^<thumb^>^</thumb^> >>"%_filename%.nfo"
echo ^<order^>1^</order^> >>"%_filename%.nfo"
echo ^</actor^> >>"%_filename%.nfo"
echo ^</movie^> >>"%_filename%.nfo"
$loopend()

```

Please note the first line  
`echo ^<^?xml version="1.0" encoding="UTF-8" standalone="yes"^?^> >"%_filename%.nfo"`  
with only one `>` in front of `"%_filename%.nfo"`.  
This means: fill the text into this filename **but OVERWRITE** everything that already exists, start from scratch.  
If you write two `>>` in front of `"%_filename%.nfo"` it means **APPEND** the text to an already existing file and content. This is the correct way for the second and all following lines in a Windows CMD batch file.

If you always use `>>`, you add the same content again and again into the same file with every call of the `Infobatch.bat`

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 29, 2025, 1:57pm UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/12 "2025-12-29T13:57:28Z")

</div>

Just for the record:  
If you want to indent elements such as the actor name, role, thumbnail and order, you can simply insert the required number of spaces between `echo` and the individual start-tag.  
The export scripts would look like this:

```auto
echo ^<actor^> >>"%_filename%.nfo"
echo ^<name^>%artist%^</name^> >>"%_filename%.nfo"
     ␣␣␣␣ <- additional spaces

```

---

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 29, 2025, 3:43pm UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/13 "2025-12-29T15:43:55Z")

</div>

THX alot !

I shall try this as soon as I can.

---

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 30, 2025, 10:01am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/14 "2025-12-30T10:01:41Z")

</div>

> [@LyricsLover](#):
>
> This version should work:
> 
> ```auto
> $filename(Infobatch.bat)$loop(%_path%)
> echo ^<^?xml version="1.0" encoding="UTF-8" standalone="yes"^?^> >"%_filename%.nfo"
> echo ^<movie^> >>"%_filename%.nfo"
> echo ^<artist^>%albumartist%^</artist^> >> "%_filename%.nfo"
> echo ^<title^>%title%^</title^> >> "%_filename%.nfo"
> echo ^<album^>%album%^</album^> >>"%_filename%.nfo"
> echo ^<genre^>%genre%^</genre^> >>"%_filename%.nfo"
> echo ^<year^>%year%^</year^> >>"%_filename%.nfo"
> echo ^<track^>^</track^> >>"%_filename%.nfo"
> echo ^<plot^>^</plot^> >>"%_filename%.nfo"
> echo ^<director^>^</director^> >>"%_filename%.nfo"
> echo ^<actor^> >>"%_filename%.nfo"
> echo ^<name^>%artist%^</name^> >>"%_filename%.nfo"
> echo ^<role^>^</role^> >>"%_filename%.nfo"
> echo ^<thumb^>^</thumb^> >>"%_filename%.nfo"
> echo ^<order^>1^</order^> >>"%_filename%.nfo"
> echo ^</actor^> >>"%_filename%.nfo"
> echo ^</movie^> >>"%_filename%.nfo"
> $loopend()
> 
> ```

THX for taking your time for this. But my result is still:

```auto
"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" 
"<movie>" 
"<artist>albumartist aaa</artist>" 
"<title>aaa title</title>" 
"<album>aaa album</album>" 
"<genre></genre>" 
"<year>2025</year>" 
"<track></track>" 
"<plot></plot>" 
"<director></director>" 
"<actor>" 
"<name>Artist aaa</name>" 
"<role></role>" 
"<thumb></thumb>" 
"<order>1</order>" 
"</actor>" 
"</movie>" 

```

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 30, 2025, 10:23am UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/15 "2025-12-30T10:23:03Z")

</div>

> [@LyricsLover](#):
>
> ```auto
> $filename(Infobatch.bat)$loop(%_path%)
> echo ^<^?xml version="1.0" encoding="UTF-8" standalone="yes"^?^> >"%_filename%.nfo"
> echo ^<movie^> >>"%_filename%.nfo"
> echo ^<artist^>%albumartist%^</artist^> >> "%_filename%.nfo"
> echo ^<title^>%title%^</title^> >> "%_filename%.nfo"
> echo ^<album^>%album%^</album^> >>"%_filename%.nfo"
> echo ^<genre^>%genre%^</genre^> >>"%_filename%.nfo"
> echo ^<year^>%year%^</year^> >>"%_filename%.nfo"
> echo ^<track^>^</track^> >>"%_filename%.nfo"
> echo ^<plot^>^</plot^> >>"%_filename%.nfo"
> echo ^<director^>^</director^> >>"%_filename%.nfo"
> echo ^<actor^> >>"%_filename%.nfo"
> echo ^<name^>%artist%^</name^> >>"%_filename%.nfo"
> echo ^<role^>^</role^> >>"%_filename%.nfo"
> echo ^<thumb^>^</thumb^> >>"%_filename%.nfo"
> echo ^<order^>1^</order^> >>"%_filename%.nfo"
> echo ^</actor^> >>"%_filename%.nfo"
> echo ^</movie^> >>"%_filename%.nfo"
> $loopend()
> 
> ```

does not result in:

```auto
"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" 
"<movie>" 
"<artist>albumartist aaa</artist>" 
"<title>aaa title</title>" 
"<album>aaa album</album>" 
"<genre></genre>" 
"<year>2025</year>" 
"<track></track>" 
"<plot></plot>" 
"<director></director>" 
"<actor>" 
"<name>Artist aaa</name>" 
"<role></role>" 
"<thumb></thumb>" 
"<order>1</order>" 
"</actor>" 
"</movie>" 

```

because the above Export script does not contain leading and trailing `"` anymore... 😉  
Please double check if you use the correct version.

This is what I get - just tested again:

```auto
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<movie> 
<artist>MKV-Albumartist</artist> 
<title>MKV-Title</title> 
<album>MKV-Album</album> 
<genre>MKV-Genre</genre> 
<year>2025</year> 
<track></track> 
<plot></plot> 
<director></director> 
<actor> 
<name>MKV-Artist</name> 
<role></role> 
<thumb></thumb> 
<order>1</order> 
</actor> 
</movie>

```

from these metadata:

 ![image](https://community.mp3tag.de/uploads/default/original/3X/4/2/42bee7e2b9bb2f6f6520a6357ad1c924bad2f5f0.png)

---

<div class="post-metadata">

### Author: ![user318](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/u/9f8e36/32.png) [@user318](https://community.mp3tag.de/u/user318)
#### Post date: [December 30, 2025, 1:01pm UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/16 "2025-12-30T13:01:44Z")

</div>

> [@LyricsLover](#):
>
> Please double check if you use the correct version.

YES ! Cheers mate ! that did the trick !

```auto
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<movie> 
<artist>albumartist aaa</artist> 
<title>aaa title</title> 
<album>aaa album</album> 
<genre></genre> 
<year>2025</year> 
<track></track> 
<plot></plot> 
<director></director> 
<actor> 
<name>Artist aaa</name> 
<role></role> 
<thumb></thumb> 
<order>1</order> 
</actor> 
</movie> 

```

Big thank you from Sweden !

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [January 29, 2026, 1:02pm UTC](https://community.mp3tag.de/t/export-1-nfo-per-mkv-file-for-kodi-help-needed/70416/17 "2026-01-29T13:02:08Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
