title: I need to match or replace an asterisk * in a batch environmental variable using only native Windows commands. Is this possible?
body: <p>I'm trying to remove an asterisk from an environmental variable string, but can't seem to do it.</p>
  
  <p>I'm creating an m3u file based around search strings, so for instance I if I want to make an m3u file containing every song with the word love in it, I would enter:</p>
  
  <pre><code>m3u *Love*
  </code></pre>
  
  <p>And m3u.bat would create the file:</p>
  
  <pre><code>xLovex.m3u
  </code></pre>
  
  <p>But the regular method of replacing characters does not work with an asterisk. (Though I don't have that problem with the question mark.)</p>
  
  <pre><code>set nam=%nam:*=x%.m3u
  </code></pre>
  
  <p>Instead creates the filename</p>
  
  <pre><code>x.m3u
  </code></pre>