Change backslash to forward slash in windows batch file

后端 未结 5 2180
醉话见心
醉话见心 2020-12-24 06:26

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         


        
5条回答
  •  忘掉有多难
    2020-12-24 06:35

    This will change the back-slashes to forward-slashes in a variable:

    set "variable=E:\myfiles\app1\data\*.csv"
    set "variable=%variable:\=/%"
    echo "%variable%"
    

提交回复
热议问题