Announcements

Help Wizard

Step 1

NEXT STEP

Is there a command to play a playlist using command line?

Is there a command to play a playlist using command line?

Hi,

I want to fall asleep and wake up to music on Spotify. I'm making a batch file to do this but I still need a command to play a playlist on Spotify. If you know how to do this can you please help. Thanks.

 

This is what I have so far -

 

@echo off
ping 1.1.1.1 -n 1 -w 10000 >nul
c:\windows\system32\taskkill.exe /f /im spotify.exe
ping 1.1.1.1 -n 1 -w 20000 >nul
C:\Users\User\AppData\Roaming\Spotify\spotify.exe

Reply
21 Replies

I only disabled random because it is usually set to random for me anyways and forgot to copy it back. 🙂

Oh, and I actually found and alternative solution because it still didn't work on Windows start up. What I did was I downloaded autohotkey, hotkeyed my media play/pause and next song button to certain keys, and then pressed those when Spotify opened.

Script code:

Set WshShell = WScript.CreateObject("WScript.Shell")
	Comandline = "C:\Users\Max\AppData\Roaming\Spotify\Spotify.exe"
	WScript.sleep 100
	CreateObject("WScript.Shell").Run("C:\Users\varga\Documents\codes\MyScript.ahk")
	WScript.sleep 500
	CreateObject("WScript.Shell").Run("spotify:user:spotify:playlist:37i9dQZEVXcX5xSSJR3tfB")
	WScript.sleep 15000
	WshShell.SendKeys "^k"

Hotkey code:

^j::Send   {Media_Play_Pause}
^k::Send  {Media_Next}

Someone might find it useful, however it has the downside of not playing the playlist which I still didn't managed to do on Windows start up. If anyone could help me I'd appreciate it. This is sufficient to me for the time being.

Suggested posts