I've been trying out Spotify for the past few days, and have been annoyed that clicking the X button in the top right of the window just minimizes it instead of closing it. In fact, even right-clicking it in the task bar and then selecting "close window" won't close it. Neither will Alt-F4.

The only two ways I know of to close it (short of killing it from the task manager) are using File → Exit or right-clicking on the tray icon and selecting Exit. Unfortunately, there don't seem to be any options to change its behavior either.

I've also noticed this behavior in other programs like Google Talk and Skype, but it makes more sense to me there since people typically want them to keep running in the background. However, I don't see why anyone would want Spotify always running even if they weren't listening to music.

Is there a way in Windows 7 to override this behavior so that clicking the X will force the program to exit? I suppose I could write an AutoHotKey script to make a keyboard shortcut that would exit it, but that seems like a hack.

  • "In fact, even right-clicking it in the task bar and then selecting "close window" won't close it". If you click Quit Spotify instead then it does close, although it takes a while. It works by calling Spotify via the command line and passing in the special parameters -taskbar spotify:internal:quit. I think it would be near impossible to modify Spotify to behave the way you want as it has several tamper-prevention systems and an auto updater. Perhaps you could suggest to the developers that they add an option to control this behaviour. – James P Aug 25 '11 at 10:49
  • @James Yeah, I'm guessing there's no good way to do it other than getting the Spotify developers themselves to change the code. I did submit a complaint to them about it when I posted this question, but who knows if they'll pay any attention to it. Hopefully, there are others complaining about it as well. – Brandon Aug 25 '11 at 19:44

The current version of Spotify now implements this behavior. Simply closing the window will close the entire application and stop music from playing in the background.

  • Not for me (I'm running Windows 8.1). The X button still behaves exactly like the minimize button---it neither closes Spotify nor stops the playback. What platform are you on? – Brandon Mar 11 '15 at 21:11
  • @Brandon: Windows 7 and Windows 8.1. It is on a Spotify Premium account, but I can't imagine that it matters. – Bill Lynch Mar 11 '15 at 21:14
  • I do not have premium... Maybe that is what is causing the difference. I suppose it could be a sneaky way of trying to encourage free users to keep it open to help with their P2P network. Still seems a little weird though. It would be interesting to hear from a few other free vs premium users to see if their experience matches ours. – Brandon Mar 11 '15 at 21:24
  • Ah, now it updated and what you said in your answer is true. I'm glad they finally fixed this. – Brandon Mar 11 '15 at 23:57
  • 1
    @BillLynch How to change this back to working as the minimize button? ;_; – user11153 Mar 16 '15 at 1:01

You can use Alt+f, x instead of Alt+F4 as a temporary solution to quickly close Spotify.


You can actually right click on the icon in the notification area and choose the open that says 'Hide from Taskbar when closed.' Then the [x] will actually close the program, not just minimize it.

Source: http://www.youtube.com/watch?v=X5reA9E7IjA

  • 6
    +1 Because this is a good way to make Spotify not clutter up your task bar when you click the X button. However, it does not actually close the program as you claim. Rather, Spotify keeps running in the background (as the balloon that pops up in the video says). Even though it's no longer in the task bar, it still has a tray icon and still shows up under the "Processes" tab of your task manager. I'm the type of person that doesn't like having extra cruft running on my computer, so I'd like it if it would fully exit the program--not just hide it. – Brandon Apr 19 '12 at 1:11
  • 4
    Downvote because this just hides the program. It still runs in the background. This is my main beef with Spotify. – Ben Jan 29 '14 at 15:55

The AHK script from cx348 seems to catch someone hitting Alt-F4 to close the window, but (at least for me) doesn't catch someone closing Spotify by clicking the "X" in the top right corner to close the window.

I created the following AutoHotKey script to also catch if someone clicks on the "X" in the top right corner of the window:

#IfWinActive ahk_class SpotifyMainWindow
LButton::Click Down
LButton Up::
WinGetActiveStats, Title, WindowWidth, WindowHeight, X, Y
MouseGetPos, MouseX, MouseY
    if ((WindowWidth - MouseX) > 6 && (WindowWidth - MouseX) < 54 && MouseY < 20) {
        Run, taskkill /F /IM spotify.exe,, Hide
    Click Up

From my (limited) understanding of how this works (as I hacked this together from a number of examples, am not an AHK expert), the script basically:

  • Applies only on the Spotify window
  • Waits for a left mouse click (down/up) action
  • When that occurs, it grabs the Active (Spotify) window size and also grabs where your mouse position was when it was clicked
  • It checks to make sure that the click was done where the X button is by computing the boundaries on the fly
  • If you did click in the area where the X is it sends a silent command to kill Spotify
  • The click action is released
  • And the script returns

Hope this is helpful to someone!


Spotify keeps itself running in the background because it uses your computer to keep the rest of the network running (see here).

In answer to your question, the best thing I can think of that hasn't already been mentioned involves having another app or scheduled task running in the background that periodically (every minute or so) checks to see if the Spotify window is visible. If it's not visible then it can send the close command.

Windows Scheduled tasks should be capable of this, but it depends how much of a problem it is.

  • 3
    +1 for the added insight on why they might want us to always have Spotify open. I didn't know that it uses P2P. In my opinion, that's still not a good enough reason to disable something as standard and basic as the X button though. I'd even prefer if the X button closed the GUI and left a background process running in the tray for the P2P stuff. At least then it gives the impression that it closed and gets it out of the way. – Brandon Sep 30 '11 at 18:15
  • 1
    Hi @Brandon. It uses P2P because that massively reduces their costs and infrastructure. If songs are popular then more people have them and Spotify themselves don't have to transfer them over the internet, it just uses other people who have listened to it. I agree that it's not a good business practice to not close the app, but I'd bet money on that being why. – Matthew Steeples Sep 30 '11 at 18:24

I do not have that application, so this is general advice. Most browsers and many other programs also have this feature. In the vast majority of them, there is an option in settings such as a checkbox for "minimize on close" or "hide in tray", or even "accelerate startup" since the app is then already open. The verbiage varies, but they all mean the same thing.

If needed, you could create a shortcut to taskkill.exe to terminate the program. But, to be gentler with it and close it instead, you could put close.exe (in zip archive) in your System32 folder and then create a shortcut using that. The command needs the name of the window that opens when Spotify runs. It can use wildcards, too. So, if the window's name (upper left corner) is "Spotify", your shortcut could be something like this:

close.exe Spot*

That would close all windows with "Spot" as the first 4 letters of their name. Close.exe is also useful for scheduling things. It is easy to start programs with the Task Scheduler, and you can schedule their closing, too, by using the same syntax.

  • 1. There's no such setting, so I doupt that a general advice would be an answer in this case. 2. How practical is it to go to the start menu/desktop to click on a shortcut when the program window that I'm trying to close is already open and in front of me? – TFM Jul 23 '11 at 10:19
  • 3
    You could easily put the shortcut on the Taskbar or in Quick Launch. Or "Show Desktop", or put a shortcut in the Start Menu. But using the File menu and clicking "Exit" in Spotify is only 2 clicks instead of 1 on the x. It is not very hard. You make it sound like once you open a program, you are doomed to never be able to use any other program. That is why the Taskbar exists. – Abraxas Jul 23 '11 at 10:51

Here are some facts to take away from this:

  • Spotify detects the close button, and cancels the form close, then minimizes the application
  • It differentiates between the close button and File->Exit

It is possible to program an application that detects the close button and/or minimization of the application, and send the same message that Spotify does when File->Exit is clicked.

Not the EASIEST solution, but should work. Maybe I'll program it...


After endless searching and since this thread here is one of the fist things that pop up at google, I will share my solution here:

I just installed AutoHotkey and wrote the following simple script:

#IfWinActive ahk_class SpotifyMainWindow
Run, taskkill /F /IM spotify.exe

If Spotify is the active Window, this will redefine the normal (not working) close-command of Alt+F4 to taskkill which will forcefully terminate spotify.

Indeed this is not very gentle, but well... seems to be the only way to close spotify without using the annoying way through the menu. And so far for me it's working without problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.