I am using mediainfo to pull metadata from an audio file and then use its information to generate a folder tree. Because this metadata allows for special characters such as astericks the folders cannot be generated. I can't seem to replace an asterisk using this script. I believe it might have to do with the fact that the *
is a wildcard. Any thoughts or questions for me?
[mcve]
@echo off
setlocal enabledelayedexpansion
set "album_name=Make Sh*t Happen"
set "album_folder=!album_name:*=_!"
set album_folder
endlocal
I expect the following result:
album_folder=Make Sh_t Happen
I've tried a variety of different methods to try and replace the *
, to no avail.
set "album_folder=!album_folder:^*=_!"
I'm definitely missing something.