I'm trying to make a batch, the objective is to run several .exe (patches) that are saved on different folders, all folders named MSXXXXXXX
The folder structure is:
- root (from where the bat will run
and so on
This is what i have so far:
echo Running from %actdir%
for /f %%i in ('dir MS* /a:D /b "%actdir%"') do (
call :infold "!actdir!" "!sub!"
for /f "tokens=* delims= " %%a in ('dir /s /b "%~1%~2"') do (
Echo Installing %%a
"%%a" /quiet /noreboot
The problem i have is that
1. It starts fine and goes trough all the folders named MSXXXX as it is supposed to but after it is done with all folders it starts with the ones named differently.
2. After it finished with the folders i dont want, it starts going trough the MSXXXX folders again, when its done it finally finishes.
I cant understand why does it do it twice and why it goes over the folder i don't care for. Maybe you guys can find where i screw up?
P.S. I've seen you guys doing whole batches in a sinlge line of code, if you have one of those magic one-liners for this i'll appreciate very much.