I have very long list of commands in my batch, where a lot of strings depend on file name of the file I work with. So I would like to somehow rewrite those parts of code with diferent variation so I could avoid manualy search for these bits and rewrite them one by one in my long batch whenever I would work with diferent file name of alt file. just an example:
Batch-1-(endlesly-long-bat).bat:
IF EXIST "*.webm" (
REN "*.webm" "COOL-PROJECT.webm"
)
FOR %%a in ("COOL-PROJECT.webm") do ffmpeg.exe -i "%%a" -vcodec copy -acodec copy "%%~na.mp4"
IF EXIST "COOL-PROJECT.mp4" (
MD "COOL-PROJECT"
)
REM so on and so on. order, type or commands itselfs are irelevant
Batch-2-(overwriting-bat).bat:
this bat needs to scan content of "Batch-1-(endlesly-long-bat).bat" and look for specific string of characters "COOL-PROJECT" and when it founds all of them, then it will replace those characters with another string of characters "WORST-NIGHTMARE". so based on input mask phrase (COOL-PROJECT) this batch needs to rewrite specific informations in first batch. (I guess trought opening it within notepad? or there is a cmd way?)