SHOW:
|
|
- or go back to the newest paste.
1 | @echo off | |
2 | setlocal enabledelayedexpansion | |
3 | :begin | |
4 | set path= | |
5 | set file= | |
6 | :top | |
7 | echo First, are the batch and file you wish to add bytes to in the same directory? (Y/N) | |
8 | set /p directory= | |
9 | if /i "%directory%"=="Y" goto good | |
10 | if /i "%directory%"=="n" goto bad | |
11 | echo Invalid answer | |
12 | goto top | |
13 | :good | |
14 | echo Enter the exact name of the file you wish too add bytes to (example: Minecraft.exe) | |
15 | set /p file= | |
16 | set files="%file%" | |
17 | if exist %files% goto continue | |
18 | echo The file cannot be found, please make sure you typed the name correctly and that the file is in the same directory as the batch. | |
19 | goto top | |
20 | :bad | |
21 | echo Please enter the file path of the file you wish to add bytes to. (Example: C:\users\username\desktop\) | |
22 | set /p path= | |
23 | cd %path% | |
24 | goto good | |
25 | - | set a=0 |
25 | + | |
26 | cd %path% | |
27 | - | echo ONLY enter numbers, letters will cause an error (a good example would be 1000). |
27 | + | set a= |
28 | echo Enter the number of bytes you wish to add to the file: (1,000 bytes = 1KB. 1,000KB = 1MB) | |
29 | - | set /a b=%bytes%/3 |
29 | + | echo ONLY enter numbers, letters will cause an error. |
30 | - | :loop |
30 | + | |
31 | - | if %a%==%b% goto end |
31 | + | if not %bytes% gtr 2 cls&echo Error, invalid input &goto continue |
32 | - | set /a a=%a%+1 |
32 | + | if %bytes% gtr 8176 set end=%bytes%&set bytes=8176 else goto skip |
33 | - | echo a>>randomer.txt |
33 | + | set /a m=%end%/%bytes% |
34 | - | goto loop |
34 | + | set /a e=%end%-3*%bytes%-2 |
35 | :skip | |
36 | - | type randomer.txt>>%files% |
36 | + | set /a byte=%bytes%-2 |
37 | - | del /f /q randomer.txt |
37 | + | for /l %%a in (1,1,%byte%) do set a=!a!a |
38 | if %bytes% leq 8176 goto end | |
39 | - | ping -n 7 localhost > nul |
39 | + | if defined e for /l %%b in (1,1,%e%) do set b=!b!b |
40 | :end | |
41 | echo %a%>>%files% | |
42 | echo Operation was successful! | |
43 | ping -n 7 localhost > nul | |
44 | pause | |
45 | goto begin |