I'm making a batch file to play AVI files in a folder in Windows Media Player (WMP11). They must be able to play in this player so I can not use VLC.
Unfortunately it doesn't seem as simple as:
start wmplayer folder\*.avi
The media player website shows that it can play a single file, how can I get it to play all of a type, or make a temporary playlist so they can be played?
Borrowed from this : SuperUser.com Answer.
I'll put it here for convenience & "archive" purposes, also adjusted for your Question.
Make sure .avi format is set to always "Open With" Windows Media Player.
1) Open a basic text editor (ie: Notepad) and paste the code shown further below.
2). Save it as PlayVids.cmd (or whatever you like but it must be saved as .cmd)
3) Double click the .cmd file to auto-open all files in folder at once. This gives you an auto-playlist.
Code for pasting into cmd file :
(replace C:\MyVideos
with your own Disc's drive + folder. If path is wrong it will fail/close)
@ECHO OFF
SET VIDFolder=C:\MyVideos
SET TempVBSFile=%tmp%\~tmpVIDTemp.vbs
:VBSDynamicBuild
IF EXIST "%TempVBSFile%" DEL /F /Q "%TempVBSFile%"
ECHO Set WshShell = WScript.CreateObject("WScript.Shell") >>"%TempVBSFile%"
ECHO WshShell.Run "%VIDFolder%" >>"%TempVBSFile%"
ECHO Wscript.Sleep 500 >>"%TempVBSFile%"
ECHO WshShell.SendKeys "^a" >>"%TempVBSFile%"
ECHO Wscript.Sleep 500 >>"%TempVBSFile%"
ECHO WshShell.SendKeys "{ENTER}" >>"%TempVBSFile%"
CSCRIPT //nologo "%TempVBSFile%"
GOTO EOF