Advertisement
Guest User

spotify install for those with appdata locked

a guest
Jun 11th, 2021
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. rem Spotify update for those who cannot run from the appdata directories.
  2. rem This process downloads the initial installer, runs it, moves the "Full" installer it installs to a place
  3. rem from which we from which we can run it, then copies the Spotify program and other files that THAT installs
  4. rem to the directory from which we desire to run it. It deletes the installers it downloads as it goes.
  5. rem
  6. rem Do not delete the Spotify installation from the Appdata directory, as Spotify appears to need it to run properly.
  7. rem
  8. rem Hit "Cancel" to the "Error 53" that the installer encounters, and then "OK" to the "Spotify could not be started" message. These
  9. rem errors are expected, and indeed are why this process is necessary in the first place.
  10.  
  11. rem rem out the "echo off" below if you are debugging this batch file
  12. echo off
  13.  
  14. set localspotifyrundir=c:\users\myusername\spotify
  15.  
  16. set tempdir=%TEMP%
  17. del %tempdir%\spot*.exe
  18.  
  19. bitsadmin /transfer spotdownload /download /priority high https://download.scdn.co/SpotifySetup.exe %tempdir%\SpotifySetup.exe
  20.  
  21. echo ****** WHEN "(Error code: 53)" COMES UP, HIT CANCEL ******
  22. %tempdir%\spotifysetup.exe
  23. timeout /t 1
  24. del %tempdir%\spotifysetup.exe
  25.  
  26. rem Copy the spotify setup program to a directory from which it can be run
  27. for /f "usebackq" %%i in (`dir /s /b c:\users\%username%\appdata\local\microsoft\windows\inetcache\ie\Spoti*.exe`) do (copy %%i %tempdir%)
  28.  
  29. rem and run it
  30. echo ****** WHEN THE "Spotify could not be started" MESSAGE COMES UP, HIT OK ******
  31. for /f "usebackq" %%i in (`dir /b %tempdir%\Spoti*.exe`) do (%tempdir%\%%i)
  32.  
  33. timeout /t 1
  34. del %tempdir%\spot*.exe
  35.  
  36. rem Now copy the installed spotify into the directory from which we wish to run it.
  37. xcopy c:\users\%username%\appdata\roaming\spotify\* %localspotifyrundir% /s /y /q
  38.  
  39. rem (2021-06-11) and delete the spotify installer, if present. If this step does not work for you, find where spotify is storing the program
  40. rem spotify_installer-(version and other junk).exe and modify this batch file to delete it
  41.  
  42. del c:\users\%username%\Appdata\Local\Spotify\Update\spotify*.exe
  43.  
  44. echo You should now be able to run Spotify from %localspotifyrundir%.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement