Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- :begin
- set path=
- set file=
- :top
- echo First, are the batch and file you wish to add bytes to in the same directory? (Y/N)
- set /p directory=
- if /i "%directory%"=="Y" goto good
- if /i "%directory%"=="n" goto bad
- echo Invalid answer
- goto top
- :good
- echo Enter the exact name of the file you wish too add bytes to (example: Minecraft.exe)
- set /p file=
- set files="%file%"
- if exist %files% goto continue
- 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.
- goto top
- :bad
- echo Please enter the file path of the file you wish to add bytes to. (Example: C:\users\username\desktop\)
- set /p path=
- cd %path%
- goto good
- :continue
- cd %path%
- set a=
- echo Enter the number of bytes you wish to add to the file: (1,000 bytes = 1KB. 1,000KB = 1MB)
- echo ONLY enter numbers, letters will cause an error.
- set /p bytes=
- if not %bytes% gtr 2 cls&echo Error, invalid input &goto continue
- if %bytes% gtr 8176 set end=%bytes%&set bytes=8176 else goto skip
- set /a m=%end%/%bytes%
- set /a e=%end%-3*%bytes%-2
- :skip
- set /a byte=%bytes%-2
- for /l %%a in (1,1,%byte%) do set a=!a!a
- if %bytes% leq 8176 goto end
- if defined e for /l %%b in (1,1,%e%) do set b=!b!b
- :end
- echo %a%>>%files%
- echo Operation was successful!
- ping -n 7 localhost > nul
- pause
- goto begin
Advertisement
Add Comment
Please, Sign In to add comment