Advertisement
Guest User

Spotify installer for people whose systems restrict executables from running under \appdata

a guest
Nov 16th, 2020
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. rem Spotify updater 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 Set the desired run directory (localspotifyrundir) below.
  12.  
  13. set localspotifyrundir=c:\users\myusername\spotify
  14.  
  15. set tempdir=%TEMP%
  16. del %tempdir%\spot*.exe
  17.  
  18. bitsadmin /transfer spotdownload /download /priority normal https://download.scdn.co/SpotifySetup.exe %tempdir%\SpotifySetup.exe
  19.  
  20. %tempdir%\spotifysetup.exe
  21. timeout /t 1
  22. del %tempdir%\spotifysetup.exe
  23.  
  24. rem Copy the spotify setup program to a directory from which it can be run
  25. for /f "usebackq" %%i in (`dir /s /b c:\users\%username%\appdata\local\microsoft\windows\inetcache\ie\Spoti*.exe`) do (copy %%i %tempdir%)
  26.  
  27. rem and run it
  28. for /f "usebackq" %%i in (`dir /b %tempdir%\Spoti*.exe`) do (%tempdir%\%%i)
  29.  
  30. timeout /t 1
  31. del %tempdir%\spot*.exe
  32.  
  33. rem Now copy the installed spotify into the directory from which we wish to run it.
  34. xcopy c:\users\%username%\appdata\roaming\spotify\* %localspotifyrundir% /s /y /q
  35. echo off
  36. echo You should now be able to run Spotify from %localspotifyrundir%.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement