Create a .bat program help.


Bryan

Well-known member
Member
Local time
2:43 PM
Posts
49
Location
New Zealand
OS
Windows 11 Pro 25H2 26200 current release
I am program writing illiterate. I am wondering if someone might be able to help construct a .bat file for me.

I have a large number of video files that are stored in Folders by the artists’ names.

What I would like is to be able to play, automatically, is the content of say Folder “A” and when it finishes the last video, call the next folder, say “B” and play all the video files in that file. And then maybe other Folders ad-infinitum.

I am using the Films and Movies App in Windows 11 with autoplay so that the next file in a folder will automatically play after the previous file finishes.

I would think it might look like: -

Folder A (Artist's name and the start song, say Summer) include autoplay next file.

Then, at the end of when the last song in Folder A finishes, call Folder B. (Artist's name and the start song, say Winter) include autoplay next file and at the end – close the job and return to Desktop.bat


If anyone can help, I would be most appreciative.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200 current releasei7 11700KF32g DDR4 @3200Gigabyte RTX3060ti
    OS
    Windows 11 Pro 25H2 26200 current release
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home DIY
    CPU
    i7 11700KF
    Motherboard
    Gigabyte Z590 Aorus Elite AX
    Memory
    32g DDR4 @3200
    Graphics Card(s)
    Gigabyte RTX3060ti
    Sound Card
    0
    Monitor(s) Displays
    Samsung Syncmaster B2430HD
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung EVO 980 500G M.2
    PSU
    600w EVGA
    Case
    Antec P280
    Cooling
    Coolmaster V6 GT
    Keyboard
    Logitech wireless K520r
    Mouse
    Logitech wirless M705
    Internet Speed
    Starlink 100mbps
    Browser
    Google
    Antivirus
    ESET
    Other Info
    Starlink
  • Computer type
    PC/Desktop
@Bryan

I'm trying to understand why these video files are grouped in separate Folders.
Wouldn't putting them all in one folder be a lot easier?
Assuming there's a reason they are in different folders, maybe rename all the videos in folder one, with a "1" in the name?
 

My Computers My Computers

  • At a glance

    Win 11 Home ♦♦♦26300.9550 ♦♦♦♦♦♦♦26H2AMD Ryzen 7 3700XG.Skill (F4-3200C14D-16GTZKW)EVGA RTX 2070 (08G-P4-2171-KR)
    OS
    Win 11 Home ♦♦♦26300.9550 ♦♦♦♦♦♦♦26H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 5302)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Total Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • At a glance

    Windows XP Pro 32bit w/SP3AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Keyboard
    Logitech Classic Keybooard 200
    Mouse
    Logitech Optical M-BT96a
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 15 years?
Thanks Ghot. I have 80 Folders each for a separate artist or a collection of similar genres. Each folder contains many files.
Putting all files in one folder would not be practical. I find it much easier to have them the way I have.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200 current releasei7 11700KF32g DDR4 @3200Gigabyte RTX3060ti
    OS
    Windows 11 Pro 25H2 26200 current release
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home DIY
    CPU
    i7 11700KF
    Motherboard
    Gigabyte Z590 Aorus Elite AX
    Memory
    32g DDR4 @3200
    Graphics Card(s)
    Gigabyte RTX3060ti
    Sound Card
    0
    Monitor(s) Displays
    Samsung Syncmaster B2430HD
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung EVO 980 500G M.2
    PSU
    600w EVGA
    Case
    Antec P280
    Cooling
    Coolmaster V6 GT
    Keyboard
    Logitech wireless K520r
    Mouse
    Logitech wirless M705
    Internet Speed
    Starlink 100mbps
    Browser
    Google
    Antivirus
    ESET
    Other Info
    Starlink
  • Computer type
    PC/Desktop
The code below is from AI. I have not even bothered to look at it so you may need to debug, but worth a shot.

Batch:
@echo off
setlocal

REM === Set your folders ===
set "FOLDER1=C:\path\to\folder1"
set "FOLDER2=C:\path\to\folder2"

REM === File extensions to play ===
set "EXTS=mp4 avi mkv mov wmv"

echo Playing videos in folder1...
for %%E in (%EXTS%) do (
    for %%F in ("%FOLDER1%\*.%%E") do (
        echo Now playing: %%~nxF
        start /wait "" "%%F"
    )
)

echo Playing videos in folder2...
for %%E in (%EXTS%) do (
    for %%F in ("%FOLDER2%\*.%%E") do (
        echo Now playing: %%~nxF
        start /wait "" "%%F"
    )
)

echo All videos finished.
endlocal
 

My Computers My Computers

  • At a glance

    Win11 Pro 26H2 (Release Preview)Intel i7-14650HX32 GBNo GPU - Built-in Intel Graphics
    OS
    Win11 Pro 26H2 (Release Preview)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic Matrix M5
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • At a glance

    Win11 Pro 26H2 (Release Preview)Intel i7-1255U16 GBIntel Iris Xe Graphics
    Operating System
    Win11 Pro 26H2 (Release Preview)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    4 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging Using an Anker 160W Charger
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
Thank you hsejestedt. That will be interesting to play with. I'll keep you informed.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200 current releasei7 11700KF32g DDR4 @3200Gigabyte RTX3060ti
    OS
    Windows 11 Pro 25H2 26200 current release
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home DIY
    CPU
    i7 11700KF
    Motherboard
    Gigabyte Z590 Aorus Elite AX
    Memory
    32g DDR4 @3200
    Graphics Card(s)
    Gigabyte RTX3060ti
    Sound Card
    0
    Monitor(s) Displays
    Samsung Syncmaster B2430HD
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung EVO 980 500G M.2
    PSU
    600w EVGA
    Case
    Antec P280
    Cooling
    Coolmaster V6 GT
    Keyboard
    Logitech wireless K520r
    Mouse
    Logitech wirless M705
    Internet Speed
    Starlink 100mbps
    Browser
    Google
    Antivirus
    ESET
    Other Info
    Starlink
  • Computer type
    PC/Desktop
Follow-up. Just for reference, below is a screenshot of the prompt I used to get that batch file. That might help you to query AI for this sort of thing in the future. In my case, I simply uses CoPilot for this...

Screenshot 2026-10-12 200130.webp
 

My Computers My Computers

  • At a glance

    Win11 Pro 26H2 (Release Preview)Intel i7-14650HX32 GBNo GPU - Built-in Intel Graphics
    OS
    Win11 Pro 26H2 (Release Preview)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic Matrix M5
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • At a glance

    Win11 Pro 26H2 (Release Preview)Intel i7-1255U16 GBIntel Iris Xe Graphics
    Operating System
    Win11 Pro 26H2 (Release Preview)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    4 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging Using an Anker 160W Charger
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
Wouldn't be easier to have a batch file create a playlist for your media player?
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Thank you garlin. Possibly but I am a true novice at this sort of thing and do not know where to begin.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200 current releasei7 11700KF32g DDR4 @3200Gigabyte RTX3060ti
    OS
    Windows 11 Pro 25H2 26200 current release
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home DIY
    CPU
    i7 11700KF
    Motherboard
    Gigabyte Z590 Aorus Elite AX
    Memory
    32g DDR4 @3200
    Graphics Card(s)
    Gigabyte RTX3060ti
    Sound Card
    0
    Monitor(s) Displays
    Samsung Syncmaster B2430HD
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung EVO 980 500G M.2
    PSU
    600w EVGA
    Case
    Antec P280
    Cooling
    Coolmaster V6 GT
    Keyboard
    Logitech wireless K520r
    Mouse
    Logitech wirless M705
    Internet Speed
    Starlink 100mbps
    Browser
    Google
    Antivirus
    ESET
    Other Info
    Starlink
  • Computer type
    PC/Desktop
It would help if you mentioned which media player you're using.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
I am using the Default Films & movie app in Windows 11.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200 current releasei7 11700KF32g DDR4 @3200Gigabyte RTX3060ti
    OS
    Windows 11 Pro 25H2 26200 current release
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home DIY
    CPU
    i7 11700KF
    Motherboard
    Gigabyte Z590 Aorus Elite AX
    Memory
    32g DDR4 @3200
    Graphics Card(s)
    Gigabyte RTX3060ti
    Sound Card
    0
    Monitor(s) Displays
    Samsung Syncmaster B2430HD
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung EVO 980 500G M.2
    PSU
    600w EVGA
    Case
    Antec P280
    Cooling
    Coolmaster V6 GT
    Keyboard
    Logitech wireless K520r
    Mouse
    Logitech wirless M705
    Internet Speed
    Starlink 100mbps
    Browser
    Google
    Antivirus
    ESET
    Other Info
    Starlink
  • Computer type
    PC/Desktop

Latest Support Threads

Back
Top Bottom