Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9276087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:45:03+00:00 2026-06-18T16:45:03+00:00

I use media player classic to play videos. I can make a batch file

  • 0

I use media player classic to play videos.
I can make a batch file to play a playlist, like this:

mpc.exe video1.avi video2.avi video3.avi ...

It works.

Now I would like to make a batch file that plays all videos in a folder sorted randomly.

Any idea?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:45:05+00:00Added an answer on June 18, 2026 at 4:45 pm

    The code below assumes you are playing files from the current directory, and it assumes none of your .avi file names begin with =. It wouldn’t take much to eliminate those limitations.

    If you have too many files in your folder, then eventually the command length will exceed the maximum allowed length of 8191 bytes.

    @echo off
    setlocal disableDelayedExpansion
    for /f "delims==" %%A in ('set file. 2^>nul') do set "%%A="
    for /f "tokens=1* delims=:" %%A in (
      'dir /b /a-d *.avi^|findstr /n "^"'
    ) do (
      set "file.%%A=%%B"
      set "cnt=%%A"
    )
    set "cmd=mpc.exe"
    for /l %%N in (%cnt% -1 1) do call :buildCmd %%N
    %cmd%
    exit /b
    
    :buildCmd
    set /a N=%random% %% %1
    set "skip="
    if %N% gtr 0 set "skip=skip=%N%"
    for /f "%skip% tokens=1* delims==" %%A in ('set file.') do (
      set cmd=%cmd% "%%B"
      set "%%A="
      exit /b
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use media player control to play mp3 files in asp.net application. I want
I use media queries on a page http://test.lovecpokladu.cz/detail-mince?id=2461 like this: @media all and (min-width:
I am looking for an open-source iTunes style media player that I can use
Since Windows Media Player 6.1, Windows has its' own mp3 decoder. Can I use
PROBLEM HISTORY: Now I use Windows Media Player SDK 9 to play AVI files
Can any one tell me how to use services for media player for playing
I'm trying to use JAudioTagger in a media player like application to yoink the
I want to use the systems available windows media player visualizers in my app.
I am writing a media player and i would like to have a progress
Just finished my code to use the default Media Player from Android, pretty pleased

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.