Bath command file path format

226 views Asked by At

If i use %%~fI in FOR command it returns with below format of file path C:\Users\Girish\Pictures\03\302.jpg. Is there any batch command that returns the file path in below format file:///C:/Users/Girish/Pictures/03/test/302.jpg ?

1

There are 1 answers

0
John DOE On

You can use string manipulation. something like this;

@echo off
set str=asd\asd
set str=%str:\=/%

echo %str%
pause

just be remember if you are working inside the for loops make sure you are using setlocal EnableDelayedExpansion and access your variables with !str! instead of %str%