Search code examples
batch-filewindows-task-scheduler

Is there a way to use a batch file to play a mp4 in a directory


Im trying to find a way so i can get task scheduler to open a batch file and, to play a video at a specific time of day, but the video changes everyday, but is in the same directory. Im sure i can get a way so it's the only video in the directory when the command is run. Im using windows 10 and would not mind using mac os or linux

Thanks!


Solution

  • Sure, your batch file can call windows media player, but it may be easier to install VLC. Then have your batch file call

    vlc c:\directory\myvideo.mp4
    

    If the file name might change, but you're sure it's the only file in the directory, then do this:

    for /r %%i in (*) do vlc %%i
    

    I believe vlc has a --fullscreen argument. Make a scheduled task to call the batch file. Season to taste.