title: How do I escape ampersands in batch file function parameter?
body: <p>This is continuation on question <em><a href="https://stackoverflow.com/questions/1327431/how-do-i-escape-ampersands-in-batch-files">How do I escape ampersands in batch files?</a></em>.</p>
  
  <p>That question presents some ways to use ampersands in batch files. However, it would seem none of those work for function parameters. Example:</p>
  
  <pre><code>@echo off
  setlocal EnableDelayedExpansion
  
  call:myFunction "http://www.google.com/search?client=opera&amp;q=escape+ampersand"
  
  goto:eof
  
  :myFunction
  echo Param is: %~1
  goto:eof
  </code></pre>
  
  <p>I would always get</p>
  
  <pre><code>Param is: http://www.google.com/search?client=opera
  'q' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  
  <p>I've tried <code>^</code> to escape it and that doesn't seem to work either. Is there a way?</p>
  
  <p>If it matters, my actual use case is supplying a download URL to wget which is called within a batch function.</p>