Skip to content

Instantly share code, notes, and snippets.

@IlyasDiker
Created March 30, 2021 12:24
Show Gist options
  • Select an option

  • Save IlyasDiker/d0ab9c2b4a62b313bbbe83f510d047e7 to your computer and use it in GitHub Desktop.

Select an option

Save IlyasDiker/d0ab9c2b4a62b313bbbe83f510d047e7 to your computer and use it in GitHub Desktop.
a batch file that will force the spotify update & fix the error code : 17 - 24 on spotify.
rem Spotify updater for those who cannot run from the appdata directories.
rem This process downloads the initial installer, runs it, moves the "Full" installer it installs to a place
rem from which we from which we can run it, then copies the Spotify program and other files that THAT installs
rem to the directory from which we desire to run it. It deletes the installers it downloads as it goes.
rem
rem Do not delete the Spotify installation from the Appdata directory, as Spotify appears to need it to run properly.
rem
rem Hit "Cancel" to the "Error 53" that the installer encounters, and then "OK" to the "Spotify could not be started" message. These
rem errors are expected, and indeed are why this process is necessary in the first place.
rem Set the desired run directory (localspotifyrundir) below.
set localspotifyrundir=c:\users\myusername\spotify
set tempdir=%TEMP%
del %tempdir%\spot*.exe
bitsadmin /transfer spotdownload /download /priority normal https://download.scdn.co/SpotifySetup.exe %tempdir%\SpotifySetup.exe
%tempdir%\spotifysetup.exe
timeout /t 1
del %tempdir%\spotifysetup.exe
rem Copy the spotify setup program to a directory from which it can be run
for /f "usebackq" %%i in (`dir /s /b c:\users\%username%\appdata\local\microsoft\windows\inetcache\ie\Spoti*.exe`) do (copy %%i %tempdir%)
rem and run it
for /f "usebackq" %%i in (`dir /b %tempdir%\Spoti*.exe`) do (%tempdir%\%%i)
timeout /t 1
del %tempdir%\spot*.exe
rem Now copy the installed spotify into the directory from which we wish to run it.
xcopy c:\users\%username%\appdata\roaming\spotify\* %localspotifyrundir% /s /y /q
echo off
echo You should now be able to run Spotify from %localspotifyrundir%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment