I want specific String later Path,
set PROJECT_FOLDER_PATH=E:\aaa\bbb\cccc
FOR /f %%i IN ('dir /b /s %PROJECT_FOLDER_PATH%\src\*.c') DO echo %%i:bbb\=%
Expected Result: cccc\src\test.c
but current Result: E:\aaa\bbb\cccc\src\test.c:bbb\=
Please, help me
test.ca folder? Is it supposed to be inPROJECT_FOLDER_PATH? What is the purpose of the=? One way to do this would be to get the name of the parent folder before theFOR /f, like this:FOR %%a in (%PROJECT_FOLDER_PATH%) do SET parent=%%~na. Then you can useparentand a similar method to get the file name from the next FOR, and put them together.