Guest User

Untitled

a guest
Oct 7th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.75 KB | None | 0 0
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3. :: Variables
  4. set driveletter=%1
  5. set RCport=%2
  6.  
  7. :: Check that the folder is valid, otherwise wait until it is
  8. echo " "| set /p dummyName=Waiting for %driveletter%: to be ready
  9.  
  10. :LOOP1
  11. vol %driveletter%: >nul 2>nul
  12. if errorlevel 1 (
  13. echo " "| set /p dummyName=.
  14. timeout /t 1 > nul
  15. goto LOOP1
  16. ) else (
  17. echo.
  18. echo %driveletter%: is now ready^^!
  19. )
  20.  
  21. echo You may use the cloud-drive normally while the cache is being warmed up...
  22. FOR /F "tokens=* USEBACKQ" %%F IN (`rclone rc vfs/refresh recursive^=true --rc-addr localhost:%RCport%`) do (
  23. set output=%%F
  24. :: Check if any line in command output contains OK and then display message
  25. if not "!output:OK=!"=="!output!" echo Cache warmup for !driveletter!: OK^^!
  26. )
Add Comment
Please, Sign In to add comment