Guest User

Windscribe Pick connection from list

a guest
Jul 21st, 2025
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | Source Code | 0 0
  1. :: Usage
  2. :: WS-Connect.cmd
  3. ::
  4. :: WS-Connect - connects to the next location in the list
  5. :: WS-Connect ranodom - connects to a random location in the list
  6. ::
  7. :: Build the list
  8.  
  9. setlocal enabledelayedexpansion
  10.  
  11. :: List of locations, you can use country code (CA), a city (Toronto), or server (Prague Staromak)
  12. Set Country=CA/Toronto/Prague Staromak
  13.  
  14. :: I found this in the internet and don't understand it. It appears
  15. :: to loop over each element and create a variable called element[i]
  16. set i=1
  17. set "element[!i!]=%country:/=" & set /A i+=1 & set "element[!i!]=%"
  18.  
  19. :: debug
  20. set element
  21. Set MaxCity=!i!
  22. echo maxcity - %maxcity%
  23. echo country=%country%
  24.  
  25. set index=0
  26.  
  27. :: If no parameter, loop through locations
  28.  
  29. If %1.==. goto :reconnect
  30.  
  31.  
  32. :OneRandom
  33.  
  34. :: Any option on the command picks a single location at random and connects
  35.  
  36. :: %random% returns a value between 0-32768. We are taking the modulus. This
  37. :: results in a number between 0-(maxcity-1) so we have to add one.
  38. :: we now have a number %in% between 1 and maxcity
  39.  
  40. SET /A in=%RANDOM% %% %Maxcity% + 1
  41. "C:\Program Files\Windscribe\windscribe-cli.exe" connect !element[%in%]!
  42. goto :exit
  43.  
  44.  
  45. :reconnect
  46. :: Reconnect to the next location in the list every 45 minutes
  47.  
  48. echo reconnect
  49. pause
  50. echo index=%index%
  51. set /a in=%index% + 1
  52. "C:\Program Files\Windscribe\windscribe-cli.exe" connect !element[%in%]!
  53.  
  54. set /a index+=1
  55. set /a index=%index% %% %MaxCity%
  56.  
  57. Timeout /T 2700
  58.  
  59. goto :reconnect
  60.  
  61. :exit
Advertisement
Add Comment
Please, Sign In to add comment