Advertisement
Guest User

RandomizeString.bat

a guest
Apr 22nd, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. :: READ ME ::
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. ::Please do not distribute this file under your own name. ::
  5. :: ::
  6. ::FILE FUNCTION: ::
  7. :: ::
  8. :: This file, when run, will take a user input string and randomize the::
  9. ::characters. The result can be written to the file ::
  10. ::RandomizeStringOut.txt. Options for writing the file are Append and ::
  11. ::Overwrite. Please take note that Overwrite will not ask you to confirm::
  12. ::and it is the same as deleting the contents of the file and replacing ::
  13. ::them with the new output string. This is irreversable. ::
  14. :: ::
  15. :: To avoid typing a long string, copy the string to your clipboard ::
  16. ::and then right click and paste into the command prompt window. ::
  17. :: ::
  18. :: If the randomized characters need more randomization, then select ::
  19. ::"'A'gain Using Output" and the randomizer will run again using the ::
  20. ::result of the first randomization. ::
  21. :: ::
  22. :: The character limit is 1,023. ::
  23. :: ::
  24. :: Special characters, such as %!,"'^><{}[]|\/, etc, may break this ::
  25. ::file. Try to avoid using special characters, in order to prevent ::
  26. ::errors and unexpected closure. ::
  27. :: ::
  28. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  29. ::WRITTEN BY RCAPRODUCTION 2016 ::
  30. :: ::
  31. ::RCAProductionMaster@gmail.com ::
  32. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  33.  
  34.  
  35. @echo off
  36.  
  37. title RandomizeString 1.0
  38.  
  39. :start
  40. cls
  41. setlocal EnableDelayedExpansion
  42.  
  43. set /p input=">"
  44.  
  45. :again
  46.  
  47. set output=%input%
  48. echo INPUT:%output%
  49.  
  50. ECHO %input%> Stringtempfile.txt
  51. FOR %%? IN (Stringtempfile.txt) DO ( SET /A total=%%~z? - 2 )
  52. del Stringtempfile.txt
  53.  
  54. echo Start:%total%
  55.  
  56. :::::::::::::::::::::::::::::::::::::::::::::
  57. :OverLoop
  58.  
  59. if %total% LEQ 0 (goto end)
  60.  
  61. set /a total=%total%-1
  62.  
  63. echo %total%
  64.  
  65. set /a ttime=%random:~0,1%
  66.  
  67. ECHO %output%> Stringtempfile.txt
  68. FOR %%? IN (Stringtempfile.txt) DO ( SET /A length=%%~z? - 2 )
  69. del Stringtempfile.txt
  70.  
  71. set /a length=%length%-1
  72.  
  73. set swap=%output:~0,1%
  74.  
  75. set output=!output:~1,%length%!
  76.  
  77. set /a length=%length%-1
  78.  
  79. ::::::::::::::::::::::::::::::::::::::::::::
  80. :loop
  81.  
  82. set move=%output:~-1%
  83.  
  84. set output=!output:~0,%length%!
  85.  
  86. set output=%move%%output%
  87.  
  88. set /a ttime=%ttime%-1
  89.  
  90. if %ttime% GTR 0 (goto loop)
  91.  
  92. set output=%output%%swap%
  93.  
  94. goto OverLoop
  95.  
  96. ::::::::::::::::::::::::::::::::::::::::::::
  97. :end
  98.  
  99. echo OUTPUT:%output%
  100. echo.
  101. choice /c AW /n /m "Run 'A'gain Using Output, or 'W'rite To File"
  102.  
  103. set input=%output%
  104.  
  105. cls
  106.  
  107. if %errorlevel%==1 (goto again)
  108.  
  109. choice /c OA /n /m "'O'verwrite RandomizeStringOut.txt, or 'A'ppend?"
  110.  
  111. if %errorlevel%==1 (goto overwrite)
  112.  
  113. echo %output%>>RandomizeStringOut.txt
  114.  
  115. goto start
  116.  
  117. :overwrite
  118.  
  119. echo %output%>RandomizeStringOut.txt
  120.  
  121. goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement