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:
%vari
This seems to work for me:
echo off
setlocal enabledelayedexpansion
FOR %%f IN ("C:\tools\workspace\*") DO (
set old=%%f
echo !old!
set new=!old:\=/!
echo !new!
echo.
)
Using a seperate variable rather than the loop variable makes the difference, along with enabling delayed expansion as the variable substittion syntex using the loop variable %%f dosn't seem to work.