Replace all Windows restricted characters to match WMP

Hi,

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

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

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

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:

\  =  Space

/  =  -

:  =  -

*  =  -

?  =  -

"  =  '

<  =  [

>  =  ]

|  =  I

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

From the documentation how to handle your [ and ] brackets:

1 Like

Cheers LyricsLover.

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

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

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