I have full path ( using "%%~fl" or %%~l )
E:\Documents\Windows-Bash\CheckModels\SB3\models\TEST3\Cerus\Modbridge\Core\g-221.mdl
My base path ( according to %~dp0 ) is:
E:\Documents\Windows-Bash\CheckModels\SB3\
How can I extract:
models/TEST3/Cerus/Modbridge/Core/g-221.mdl
To search for it inside a text file.
My batch script is like follows:
echo off
set DataBase=E:\Documents\Windows-Bash\CheckModels\SB3\DB\trackassembly_init.lua
set AddModel=models_present.txt
set MisModel=models_missing.txt
set BasePath=%~dp0
set Model
dir /a-d /b /s *.mdl > %AddModel%
for /F "tokens=*" %%l in ('type "%AddModel%"') do (
set Model=%%~l
:: ?[1] Process the %Model% so it becomes "models/TEST3/Cerus/Modbridge/Core/g-221.mdl"
:: ?[2] IF (not found %Model% in the contents of %DataBase% ) THEN
:: ?[2] echo Model > MisModel ( Append missing file )
:: ?[2] END
)
del %AddModel%
echo End
timeout 25
How can I replace the pseudo-code in ?[1] and ?[2] with the real thing ? I can easily convert the string using C/C++, but I do not need additional files. Is there a way the whole thing to be converted to C/C++ ?