# Replace all Windows restricted characters to match WMP

**URL:** <https://community.mp3tag.de/t/replace-all-windows-restricted-characters-to-match-wmp/58599>\
**Category:** Support\
**Created:** [September 27, 2022, 10:03am UTC](https://community.mp3tag.de/t/replace-all-windows-restricted-characters-to-match-wmp/58599 "2022-09-27T10:03:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![keylonta](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/9e8a1a/32.png) [@keylonta](https://community.mp3tag.de/u/keylonta)\
**Post date:** [September 27, 2022, 10:03am UTC](https://community.mp3tag.de/t/replace-all-windows-restricted-characters-to-match-wmp/58599/1 "2022-09-27T10:03:58Z")

</div>

Hi,

Why are these format strings invalid, Is there a workaround?

```auto
$replace(%title%,a,')
$replace(%title%,a,])
$replace(%title%,a,[)

```

I tried the following Format Value action but ' ] [ is corrupting the script:

```auto
Field: _FILENAME
Format String: $replace($num(%track%,2) %title%,\, ,/,-,:,-,*,-,?,-,",',<,[,>,],|,I)

```

What's the best method for replacing all the Windows restricted characters \ / : \* ? " \< \> |

I want them to match how WMP replaces restricted characters when using the WMP option "Apply Media Information Changes" which applies the tags to the filenames and replaces the restricted characters with the following:

```auto
\ = Space

/ = -

: = -

* = -

? = -

" = '

< = [

> = ]

| = I

```

---

<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:** [September 27, 2022, 10:35am UTC](https://community.mp3tag.de/t/replace-all-windows-restricted-characters-to-match-wmp/58599/2 "2022-09-27T10:35:23Z")

</div>

> [@keylonta](#):
>
> What's the best method for replacing all the Windows restricted characters \ / : \* ? " \< \> |

The best method is the one that achieves exactly what you want for your files in your environment.

From the [documentation](https://docs.mp3tag.de/format/#characters-with-special-functionality) how to handle your [and] brackets:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/f/fd00797f418f1e2fd83ce2e59d6f93e46eb44fb2.png)

---

<div class="post-metadata">

**Author:** ![keylonta](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/9e8a1a/32.png) [@keylonta](https://community.mp3tag.de/u/keylonta)\
**Post date:** [September 28, 2022, 5:03am UTC](https://community.mp3tag.de/t/replace-all-windows-restricted-characters-to-match-wmp/58599/3 "2022-09-28T05:03:08Z")

</div>

Cheers LyricsLover.

So here is the script that matches the WMP tag to filename option (Apply Media Information Changes).

```auto
$replace($num(%track%,2) %title%,\, ,/,-,:,-,*,-,?,-,",'',<,'[',>,']',|,I)

```

---

<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:** [October 28, 2022, 5:03am UTC](https://community.mp3tag.de/t/replace-all-windows-restricted-characters-to-match-wmp/58599/4 "2022-10-28T05:03:31Z")

</div>

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