Page 1 of 1

shut down pc after playlist

Posted: 20 Feb 2013 12:12
by phantom16
Greetings everyone, I have googled the snot out of this, and have read into it, but I just can't get it to work, so I would appreciate any and all help i can get.
I really just wish i could play some music/movie, go to bed, and have the computer shut off when it was done, but that's not something I guess VLC does off the get go (i dunno why, it would be super helpful).

So I have searched and have found this:
http://wiki.videolan.org/How_to_shut_down_computer
I have exactly this as my .bat file:

Code: Select all

START /WAIT C:\"Program Files (x86)"\VideoLAN\VLC\vlc.exe %1 vlc://quit shutdown -s -t 60
(program file has to be different due to it being located in the x86 directory)
I have a playlist with just 1 song, and i drag and drop it, vlc opens with a command prompt line, it plays the song, and has the quit command after the current song. But then once the song ends and it goes to the quit command, vlc does quit, but the command line spits out

Code: Select all

C:\Users\bridger\Desktop>shutdown -s -t 60 C:\Users\bridger\Desktop>START /WAIT C:\"Program Files (x86)"\VideoLAN\VLC\vlc.exe -s vlc://quit
and there is a system error message saying "The command line option could not be parsed. Make sure they are valid"
I tinkered around a bit, but i Just can't get it to work, and i have no programming knowledge, so I really don't know what's going on.

I have also found this, http://en.kioskea.net/faq/3677-vlc-auto ... of-a-video
I like that method way more since I can just manually type in the song and run it, but i still can't get it to work
regardless, i tried it, i have a .bat file that reads:

Code: Select all

C:\"Program Files (x86)"\VideoLAN\VLC\vlc.exe C:\Users\bridger\Desktop\song.mp3 vlc://quit shutdown -s -t 60
(I don't have the quotation after the vlc.exe because if i do it just yields an error)
And then when i click it, it bring up vlc, but then it gives me this error message:

Code: Select all

File reading failed: VLC could not open the file "C:\Users\bridger\Desktop\Files". (%m) Your input can't be opened: VLC is unable to open the MRL 'file:///C:/Users/bridger/Desktop/Files'. Check the log for details. Your input can't be opened: VLC is unable to open the MRL '(x86)\VideoLAN\VLC\vlc.exe C:\Users\bridger\Desktop\song.mp3 vlc://quit '. Check the log for details.
I don't know why vlc is trying to open these things, as far as i can tell, I never told it to open...desktop\files, so i don't see why it's getting that error.
then if i close out of vlc since all there is is a "files" song, and a "quit' song (and neither do anything, they both just bring up the same error message) I then get the same system error as the command line could not be parsed...

If anyone could provide any insight i would greatly appreciate it. I am running windows 7 64 bit, and have vlc v.2.0.5
In my tinkering around earlier I did manage to get it so somehow vlc popped up, then immediatly closed and actually would shut down the system after 60 seconds (which i stopped), but I wasn't quite paying attention to how i got there, and don't remember :/. It's 4am and i have been trying to get this stupid thing to work for hours now haha

Re: shut down pc after playlist

Posted: 20 Feb 2013 15:16
by mederi
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"

Re: shut down pc after playlist

Posted: 20 Feb 2013 19:10
by phantom16
are you saying that i need to put quotations around the whole location? I tried that, and with the first option (seperate .bat and playlist) it does bring up vlc, but the quit command isn't there now. if i manually quite then command prompt says the same thing as before, and I get the system error:

Code: Select all

Windows cannot find '-s'. Make sure you typed the name correctly, and then try again.

for the second option (with the song listed in the .bat file) it brings up vlc, plays the song, and has the quit command, but after it quits command prompt now spits out the same thing as before, and i get the same system message about not finding '-s'.

I don't know why the command prompt is trying to do
C:\Users\bridger\Desktop>START /WAIT C:\"Program Files (x86)"\VideoLAN\VLC\vlc.exe -s vlc://quit
It's nothing I told it to do, but it seems that's what it's trying to do

Re: shut down pc after playlist

Posted: 20 Feb 2013 22:39
by mederi
Come on!

Code: Select all

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %1 vlc://quit shutdown -s -t 60
You do not need to use "START /WAIT" command. If you do, then you should do it properly.

Re: shut down pc after playlist

Posted: 21 Feb 2013 03:04
by phantom16
hmm, well I was just doing what the wiki said to do, but i followed your instructions. my .bat now reads:

Code: Select all

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %1 vlc://quit shutdown -s -t 60
but it still doesn't work.

After it quits VLC, I get the same command prompt output of

Code: Select all

C:\Users\bridger\Desktop>shutdown -s -t 60 C:\Users\bridger\Desktop>START /WAIT C:\"Program Files (x86)"\VideoLAN\VLC\vlc.exe -s vlc://quit
and i still get the system error message saying: "The command line options could not be parsed. Make sure they are valid" :/

Re: shut down pc after playlist

Posted: 22 Feb 2013 12:50
by mederi
Can't you just check syntax of shutdown in your command line shell? It is a bit different on Windows 7:
http://www.thespinningdonut.com/how-to- ... -computer/
Image

Code: Select all

shutdown /s /t 60
BINGO! :D

Re: shut down pc after playlist

Posted: 10 Mar 2013 06:48
by phantom16
So i tried changing the codes to incorporate /s /t, but it just seems to make the problem worse. when i do:

Code: Select all

START /WAIT "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %1 vlc://quit shutdown /s /t 60
and drag the playlist on it, it brings up vlc, but without any quit command
if i manually quit the command prompt just goes nuts, and it's like it is trying to type something over and over. It goes so fast i really cant see what it's saying, but it looks as if it's repeating the command inside the .bat file, but then i keep catching glimpses of something mentioning "invalid" but that's all i can see before it's gone.

If i do the:

Code: Select all

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" C:\Users\bridger\Desktop\song.mp3 vlc://quit shutdown /s /t 60
it does bring up the quit command in vlc and quits appropriately, but then it just does the same thing with the previous code in the command prompt and just cycles the code forever super fast.

Any idea what i'm doing wrong or to try now?

Re: shut down pc after playlist

Posted: 10 Mar 2013 14:49
by mederi
If you need to use command START, then:
START "" /WAIT "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %1 vlc://quit
Better if some Windows 7 user will help you to find a solution. Perhaps you have not rights to shutdown computer from command line. Just check standalone
shutdown /s /t 60

Re: shut down pc after playlist

Posted: 14 Apr 2013 07:55
by phantom16
sigh, i just can't get what seems like such a simple thing to do to work.

I do have the right permissions, if i just bring up the command prompt and type in shutdown /s /t 60 it shuts down in 1 minute as it should.
But then i decided to try something, i just created a bat file, with nothing in it but the shutdown /s /t 60 command to see if that would work, and it doesn't.

It just cycles through the code forever really fast like any of the 2 other command files
It seems to be the problem is just running a .bat isn't working right, and it's not properly executing as it should and just keeps cycling through the code without actually carrying any of it out. is there a way to stop this? like some stop or end command that will just stop it from doing the command over and over and instead just do it once where it actually does what it's supposed to do?

Re: shut down pc after playlist

Posted: 05 Jan 2019 12:52
by scooby5769
START /WAIT "C:\Program Files\VideoLAN\VLC\vlc.exe" %1 vlc://quit
shutdown -f -s -t 60

Tested and working well