I want to create a bat file with which a specific action will be performed under all the subfolders of a certain path.
I have already made a file with which I can execute my action under a specific folder(C:\IPSL\T125\LM55786_UUS\SIPSTK\PARSING_MIDDLE\PARSING_MIDDLE10\main) individually:
echo off
cd C:\IPSL\T125\LM55786_UUS\SIPSTK\PARSING_MIDDLE\PARSING_MIDDLE10\main
del *.ITS
del *.TRC
del *.dbc
ipslc /B /p%toolpath%\ipsl\sip01\sip01.prf -cits -m "*.ctl"
ipslc /B /p%toolpath%\ipsl\sip01\sip01.prf -cits -m "*.scr"
echo
pause
The script above works fine but just for the files under the specific folder "PARSING_MIDDLE10\main".
What I need is this actions to be performed to all subfolders under "C:\IPSL\T125\LM55786_UUS\SIPSTK\PARSING_MIDDLE\".
I have modified the bat file as below but it does not work
![Sad :(](./images/smilies/icon_sad.gif)
echo off
cd C:\IPSL\T125\LM55786_UUS\SIPSTK\PARSING_MIDDLE\
for /r %%g in (.) do
del *.ITS
del *.TRC
del *.dbc
ipslc /B /p%toolpath%\ipsl\sip01\sip01.prf -cits -m "*.ctl"
ipslc /B /p%toolpath%\ipsl\sip01\sip01.prf -cits -m "*.scr"
echo
pause
Any idea;
Thanks
Nikos