# VLC find out when movie stops from cmd

I am working with VLC from C# by creating a process that opens the command line.

Is there any way of knowing when a movie ended in from the command line or something ?

-

If you add vlc://quit to the playlist after the intended file you want to play, VLC will quit after playback has finished. This is surely possible to catch from the command-line.

(Perhaps this is also what you really are trying to do: quit VLC after playback has finished and let the script continue.)

-
vlc.exe file.xxx vlc:quit


Then, wait for your process to terminate:

var info = new System.Diagnostics.ProcessStartInfo();
info.FileName = @"c:\path\to\vlc.exe file.xxx vlc:quit";
var process = new System.Diagnostics.Process();
process.StartInfo = info;
process.Start();

//Wait for the process to be completed
process.WaitForExit();

//It's finished. Enter your code here.

-
It is also worth noting that VLC has a command-line varient (CVLC/CVLC.exe) which is functionally the same, however it simply launches a video window that has no controls or menus unless you explicity enable them. Which depending on your usage may be a slightly improved situation. –  Turix Apr 13 '12 at 11:17