SET "string=D:\path\to\folder"
ECHO %string:\=/%
Basically, you need first to store the string value into an environment variable, then use the following template:
%variable:str1=str2%
to replace every occurrence of str1
in variable
with str2
.
You can always remind yourself about this pattern by invoking SET /?
from the command prompt.