Re: How to play video file repeatedly using command prompt
I don't think it's possible, but can one activate "repeat" in this media player with command line parameters? I can't think of other way to enable it via batch.
Everything below this line must be read assuming you can't enable "repeat" with CL parameters.
By the way, let's assume 3 other things:
1. You're using media player classic (executable name: "mpc hc.exe")
2. The video file is in the same folder as mpc hc.exe and its name is "video file.avi"
3. The batch script is in the same folder as mpc hc.exe
You said the video has 2 minutes; we can do something like this:
::n is the number of times you want the video to loop
::if program = 30mins of lenght and video = 2mins, then n should be 15
for /l %%n in (1 1 %n%) do (
start "" "mpc hc.exe" "video file.avi"
>nul ping -n 121 localhost
taskkill /f /im "mpc hc.exe"
Let's call this script "play_video.bat".
And you would probably have to start it from another batch.
Once again, assuming it is in the same folder as the others (otherwise, write the full path to play_video.bat)
start /min play_video.bat
if not %errorlevel% == 0 goto video
::your code here