Bat file that can create a text file of any exact size and it will be compression resistant
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I'm making a bat file that can create a text file of any exact size and it will be compression resistant just for fun. It's currently in 2 parts because that's the only way I could figure out how to do it. I tried running the second part in a loop in the first one so I didn't need to use the call command but it didn't work.
The problem is that it takes forever and my CPU peaks at 31% so I'm wondering if there is a way to make it use the CPU more so it can execute faster or just make my code more efficient so it runs faster.
This is part one:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
@echo on
@set /a "gTotal=%Total%/1"
echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
echo %pTotal% PB
echo to create %gTotal%GB_RandPass.txt press any key
pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
for /l %%x in (1, 1, %d%) do (
call "create_1GB-2EB_fileV4_Part2.bat"
)
:: @echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
This is part 2:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
::@echo on
@set /a "gTotal=%Total%/1"
::echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
::echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
::echo %pTotal% PB
echo createing %gTotal%GB_RandPass.txt Please wait.
::pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
::@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
::for /l %%x in (1, 1, %d%) do (
@echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
performance random compression batch
add a comment |Â
up vote
1
down vote
favorite
I'm making a bat file that can create a text file of any exact size and it will be compression resistant just for fun. It's currently in 2 parts because that's the only way I could figure out how to do it. I tried running the second part in a loop in the first one so I didn't need to use the call command but it didn't work.
The problem is that it takes forever and my CPU peaks at 31% so I'm wondering if there is a way to make it use the CPU more so it can execute faster or just make my code more efficient so it runs faster.
This is part one:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
@echo on
@set /a "gTotal=%Total%/1"
echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
echo %pTotal% PB
echo to create %gTotal%GB_RandPass.txt press any key
pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
for /l %%x in (1, 1, %d%) do (
call "create_1GB-2EB_fileV4_Part2.bat"
)
:: @echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
This is part 2:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
::@echo on
@set /a "gTotal=%Total%/1"
::echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
::echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
::echo %pTotal% PB
echo createing %gTotal%GB_RandPass.txt Please wait.
::pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
::@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
::for /l %%x in (1, 1, %d%) do (
@echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
performance random compression batch
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm making a bat file that can create a text file of any exact size and it will be compression resistant just for fun. It's currently in 2 parts because that's the only way I could figure out how to do it. I tried running the second part in a loop in the first one so I didn't need to use the call command but it didn't work.
The problem is that it takes forever and my CPU peaks at 31% so I'm wondering if there is a way to make it use the CPU more so it can execute faster or just make my code more efficient so it runs faster.
This is part one:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
@echo on
@set /a "gTotal=%Total%/1"
echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
echo %pTotal% PB
echo to create %gTotal%GB_RandPass.txt press any key
pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
for /l %%x in (1, 1, %d%) do (
call "create_1GB-2EB_fileV4_Part2.bat"
)
:: @echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
This is part 2:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
::@echo on
@set /a "gTotal=%Total%/1"
::echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
::echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
::echo %pTotal% PB
echo createing %gTotal%GB_RandPass.txt Please wait.
::pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
::@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
::for /l %%x in (1, 1, %d%) do (
@echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
performance random compression batch
I'm making a bat file that can create a text file of any exact size and it will be compression resistant just for fun. It's currently in 2 parts because that's the only way I could figure out how to do it. I tried running the second part in a loop in the first one so I didn't need to use the call command but it didn't work.
The problem is that it takes forever and my CPU peaks at 31% so I'm wondering if there is a way to make it use the CPU more so it can execute faster or just make my code more efficient so it runs faster.
This is part one:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
@echo on
@set /a "gTotal=%Total%/1"
echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
echo %pTotal% PB
echo to create %gTotal%GB_RandPass.txt press any key
pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
for /l %%x in (1, 1, %d%) do (
call "create_1GB-2EB_fileV4_Part2.bat"
)
:: @echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
This is part 2:
@set GB=1
@set TB=0
@set PB=0
@set /a "g=1*%GB%"
@set /a "t=1024*%TB%"
@set /a "p=1048576*%PB%"
@set /a "Total=%g%+%t%+%p%"
@set /a "c=%Total%*262144"
@set /a "d=%c%-1"
::@echo on
@set /a "gTotal=%Total%/1"
::echo %gTotal% GB
@set /a "tTotal=%gTotal%/1024"
::echo %tTotal% TB
@set /a "pTotal=%tTotal%/1024"
::echo %pTotal% PB
echo createing %gTotal%GB_RandPass.txt Please wait.
::pause
@Echo Off
color 0a
::set /P lengthnumberuser="What length do you want your password to be? "
::pause
::cls
Setlocal EnableDelayedExpansion
Set _RNDLength=4101
Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Set _Str=%_Alphanumeric%987654321
:_LenLoop
IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
SET _tmp=%_Str:~9,1%
SET /A _Len=_Len+_tmp
Set _count=0
SET _RndAlphaNum=
:_loop
Set /a _count+=1
SET _RND=%Random%
Set /A _RND=_RND%%%_Len%
SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
If !_count! lss %_RNDLength% goto _loop
Echo Password is: is !_RndAlphaNum!
::pause
::@echo %_RndAlphaNum%> %gTotal%GB_RandPass.txt
::for /l %%x in (1, 1, %d%) do (
@echo %_RndAlphaNum%>> %gTotal%GB_RandPass.txt
::)
performance random compression batch
edited Apr 18 at 1:30
Jamalâ¦
30.1k11114225
30.1k11114225
asked Apr 17 at 14:15
Kodi4444
61
61
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f192294%2fbat-file-that-can-create-a-text-file-of-any-exact-size-and-it-will-be-compressio%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password