Advertisement
GlobalAccessSoftware

playlist_backups.bat

Nov 16th, 2023
986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.67 KB | Software | 0 0
  1.  
  2.  
  3. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. ::set vers=7.9.6.53
  5. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  6. REM onERR echo playlist_backups.bat & pause
  7. REM set vers=v7.9.9.02 20221219053521 by -JpE-
  8. echo %l2%
  9. echo .
  10. echo %sl%
  11. echo        ****   Playlist Backup Ultra Pro Deluxe   ****
  12. echo          ***  %vers% ***
  13. echo %sl%
  14. echo .
  15. echo %l1%
  16. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  17. set /A bak=0
  18. :: set to 1 to clear Docs copy, 2 to clear I: and recopy, 3 to clear X: and 4 to skip entirely.
  19. set /a err=0
  20.  
  21. set source3="M:\Playlists"
  22. if not exist %source3% set /a err=1
  23. if %err% equ 1 goto errwas
  24.  
  25. set dox=C:\Users\%username%\Documents
  26. if not exist %dox% set /a err=2
  27. if %err% equ 2 goto errwas
  28.  
  29. set destin3="%dox%\My Playlists Backup"
  30. if not exist %destin3% set /a err=2 & goto errwas
  31. echo %time%
  32. echo .
  33. echo %sl%
  34. echo            ***  Backing up Playlists Locally  ***
  35. echo %sl%
  36. echo .
  37. if %bak% gtr 0 del /f /s /q %destin3%"\"*.*
  38. xcopy %source3%"\"*.* %destin3% /D /E /V /C /F /G /R /K /Y /Z /B /J
  39. echo .
  40.  
  41. if %errorlevel% neq 0 set /a err=3
  42. if %bak% gtr 3 goto finish
  43. if %errorlevel% neq 0 goto xtrnl1
  44. echo %sl%
  45. echo         *** Success, Playlists backed up Locally ***
  46. echo %sl%
  47. echo .
  48. echo %l1%
  49. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  50.  
  51.  
  52. :xtrnl1
  53. set /a rt=1
  54. set dir=I:
  55. set mtxt= Backup1
  56. set dest="%dir%\My Music\Playlists"
  57. if not exist %dir% set /a err=4 & goto errwas
  58. if not exist %dest% set /a err=4 & goto errwas
  59. ::::::::::
  60. call :copyx
  61. ::::::::::
  62. if %errorlevel% neq 0 set /a err=5 & goto errwas
  63.  
  64.  
  65. :xtrnl2
  66. set /a rt=2
  67. set dir=X:
  68. set mtxt=Seagate7
  69. set dest="%dir%\My Mom's Music\My PlayLists"
  70. if not exist %dir% set /a err=6 & goto errwas
  71. if not exist %dest% set /a err=6 & goto errwas
  72. ::::::::::
  73. call :copyx
  74. ::::::::::
  75. if %errorlevel% neq 0 set /a err=7 & goto errwas
  76. echo .
  77.  
  78.  
  79. ::: Why R not U:\? Well, it's already backed up in the
  80. ::: doc fldr, so everywhere that's backed, these are.
  81. :xtrnl3
  82. set /a rt=3
  83. set dir=R:
  84. set mtxt=Mid Earth
  85. set dest="%dir%\My Mom's Music\My_Playlists_Cover_All"
  86. if not exist %dir% set /a err=8 & goto errwas
  87. if not exist %dest% set /a err=8 & goto errwas
  88. ::: Special Consideration for Catch-All
  89. set /a bck=%bak%
  90. set /a bak=0
  91. :::::::::::
  92. call :copyx
  93. set /a bak=%bck%
  94. if %errorlevel% neq 0 set /a err=9 & goto errwas
  95. echo .
  96. :::::::::::
  97. goto finish
  98.  
  99.  
  100. :copyx < sourceString, destinationString>
  101. echo %time%
  102. echo .
  103. echo %sl%
  104. echo        *** Backing up Playlists to %mtxt% (%dir%)  ***
  105. echo %sl%
  106. echo .
  107. if %bak% gtr 2 del /f /s /q %dest%"\"*.*
  108. xcopy %destin3%"\"*.* %dest% /D /E /V /C /F /G /R /K /Y /Z /B /J
  109. if %errorlevel% neq 0 goto end
  110. echo .
  111. echo %sl%
  112. echo         *** Success, Playlists backed up to (%dir%) ***
  113. echo %sl%
  114. echo .
  115. echo %l1%
  116.  
  117. :end
  118. exit /b %errorlevel%
  119.  
  120.  
  121. :finish
  122. if %err% equ 0 goto success
  123.  
  124.  
  125. :errwas
  126. set eros="%bats%\playlist_errors.bat"
  127. if not exist %eros% echo . & echo %eros% not found! & echo . & pause & echo . & goto return
  128. ::::::::::::::
  129. call %eros%
  130. ::::::::::::::
  131. if %err% equ 2 goto return
  132. ::: bak 4 means Finish Simple-Backup Early. IF err!=3 Success!
  133. if %bak% equ 4 if %err% gtr 4 goto success
  134. ::
  135. if %err% equ 1 set /a err=0 & goto xtrnl1
  136. if %err% equ 3 set /a err=0 & goto xtrnl1
  137. ::
  138. if %rt% gtr 0 set /a err=0
  139. if %rt% equ 1 goto xtrnl2
  140. if %rt% equ 2 goto xtrnl3
  141. if %rt% equ 3 goto finish
  142. ::
  143. if %err% equ 9 goto return
  144. if %err% equ 7 goto return
  145. if %err% equ 5 goto return
  146.  
  147.  
  148. :success
  149. echo .
  150. echo %sl%
  151. echo          **** Success!  Everything Went Well.  ****
  152. echo %sl%
  153. echo .
  154.  
  155.  
  156. :return
  157. ::pause
  158.  
  159.  
  160.  
  161. :: 100% -JpE-
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement