Run script on all file in a folder

Hi!
i want to run my script on all the file in a folder, i make a bat file but i know how to run the file by writing them one by one, here is my example:

cd C:\Program Files\Blender Foundation\Blender 2.93

blender -b "C:\M.blend" --python "C:\bat.py"
blender -b "C:\\3-M.blend" --python "C:\bat.py"

but i cant find a way to do a loop on all the files in the folders and run this script on them

Example code imports all objs with the given name from current dir and all its subdirs. To use, change to respective dir and start Blender from there via command line. This code runs as is, just adapt it to your needs.

import os
import bpy
File = "model.2.obj"
for root, dirs, files in os.walk('.'):
    for file in files: # loops through directories and files
        if file == File: # compares to specified condition
            #pot = os.getcwd()
            pot2 = os.path.join(root,file)
            print("Pot2 = ", pot2)
            imported_object = bpy.ops.import_scene.obj(filepath=pot2)
            for x in bpy.data.textures: x.extension = 'EXTEND'
            print ("File exists", files)

thx for the help, but i found the solution that I want, here is the code that solve my problem:

cd C:\Program Files\Blender Foundation\Blender 2.93
for %%f in (C:\*.blend) do blender -b %%f --python "C:\bat.py"

I just wrote an Autohotkey (v1) script that does this. It has a UI to simplify things, and a resume function.

For anyone interested, you can check it out here: https://github.com/Flowgun/BlenderBatcher