Depending on the text after 'X' and before 'Open file' in mypath variable, I want to call a function passing this text as argument in order to replace it by 'foo'. To do it, I have written
@echo off
SET mypath=Y:\SUT\ISTQB\Board Airport\X\Dashboard\Open file
if /i %1=="Dashboard" goto label %1
if /i %1=="Dboard" goto label %1
:label
SET mypath=%mypath:\%1\=foo%
ECHO %mypath%
I notice that echoing mypath at the end of that script outputs
Y:\SUT\ISTQB\Board Airport\X\Dashboard\Open file instead of
Y:\SUT\ISTQB\Board Airport\X\foo\Open file
I think of the issue is about parameter %1 within 'SET mypath=%mypath:\%1\=foo%', but I don't understand why.
In fact I absolutely need to use parameter %1 because the text which is currently "Dashboard" into mypath variable is not a static text. It can be "Dboard", or anything
Someone could explain me? Thank you in advance