Page 1 of 1

play-and-exit issue

Posted: 13 Dec 2022 22:23
by bw_wyo
I am writing a PowerShell script that uses the VLC command-line interface to load a playlist and play it. I want it to play the playlist and then exit. Everything works, except it doesn't exit at the end. My code looks like this:

Code: Select all

$musicPLayer = "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" Start-Process -FilePath $musicPlayer -ArgumentList """$path1"" --playlist-enqueue --one-instance" Start-Process -FilePath $musicPlayer -ArgumentList """$path2"" --playlist-enqueue --one-instance" Start-Process -FilePath $musicPlayer -ArgumentList """$path3"" --playlist-enqueue --one-instance" Start-Process -FilePath $musicPlayer -ArgumentList " --play-and-exit --one-instance"
Any suggestions? Is there a better way to do it?