I am looping through a series of sub-directories using a for loop
For /R %1 %%f IN (*.shp) do (
I need to convert the file path %%f from a backslash to a forward slash.
set old=%%f
set new=!old:\=/!
echo !new!
echo|(set /p="CALL spatial.importShapefileToLayer('%%~nf', '!new!');" & echo.) >> test.cypher
As the code is now, the !new! text is written as a literal to the test.cypher
CALL spatial.importShapefileToLayer('N00E006_D100_S004_T007_L00_U0_R0', '!new!');
What I need to write to the output is the value of !new!
CALL spatial.importShapefileToLayer('N00E006_D100_S004_T007_L00_U0_R0', 'c:/test/N00E006_D100_S004_T007_L00_U0_R0.shp');
The echo of the !new! to the screen does show the correction of backslash to forward slash, so the !new! variable is receiving the correction
Ideas on how to correctly use the !new! contents in the output string would be appreciated.
edit : setlocal EnableDelayedExpansion
was included in the batch file