I have the following code sample in C:\\myscript.bat
for /f %%i in (\'dir "C:\\files" /b /a-d /o-d\') do ( if /i "%%~xi"==".vib" ( g