title: Change backslash to forward slash in windows batch file
body: <p>I'm trying to convert all backslashes () to forward slashes (/) in a variable which contains a file name and location. I've read about this and seen:</p>
  
  <pre><code>%variable:str1=str2%
  </code></pre>
  
  <p>and</p>
  
  <pre><code>set "var=%var:\=/%"
  </code></pre>
  
  <p>which I've attempted, but I'm obviously not getting it right.</p>
  
  <p>Here is the relevant section of my .bat script:</p>
  
  <pre><code>FOR %%f IN ("E:\myfiles\app1\data\*.csv") DO (
    echo %%f  
    set "f=%%f:\=/%"
    echo %%f  
    echo.                 
  )
  </code></pre>
  
  <p>The output show each filename listed twice. </p>
  
  <p>i.e. this line:</p>
  
  <pre><code>set "f=f:\=/%"
  </code></pre>
  
  <p>is not doing what I want it to. Can anyone see what I am doing wrong?</p>