0

I am trying to create a Pseudo GUI for the TrueRNG Hardware using RNGCapture.exe and a custom Batch Based Menu. The RNGCapture program is only command line and a Royal Pain to create Multiple Entropy FIles in Succession.

My Script is able to loop to many predefined counts and file sizes to accomodate a large number of user needs, as well as allow you to enter custom parameters to create a custom loop with user chosen file sizes and file counts.

My issue is i am experiencing Collision on account of using %Random% as a file name placeholder.

The script fires without issue other than the Collision i have described but also the file count is not 10 but 9, this is consistent across multiple tests.

I would like to implement a custom variable to introduce a random string of letters into the filename to eliminate my issue, how do i go about this?

THIS IS NOT A SCHOOL PROJECT, THIS IS PERSONAL! I Have done 95% of the legwork myself. If needed i can post the entire script but i would prefer not to until it's finished as i want to put it on my Blog and Linkedin

@echo off
:start3
set /a var+=1
if %var% EQU 10 goto end3
rngcapture.exe %ChosenComm% C:\rngcapture\10Files20MB\%RANDOM%%RANDOM%%RANDOM% 20971520
goto start3
:end3
echo var has reached %var%.
pause
GOTO MainMenu
3
  • 1
    Your file count is 9 instead of 10 because you start by incrementing var (so it is now 1, not 0) and on it being 10 you exit the loop. As a result the 10th run will never happen. You need to move the If equ 10 after the rngcapture line.
    – Mokubai
    Dec 19, 2017 at 9:41
  • I made the adjustments you Suggested and am trying a test run now, thx! Dec 19, 2017 at 10:14

1 Answer 1

0

Mokubai is correct, the revised script works as follows...

@echo off
:start3
set /a var+=1
rngcapture.exe %ChosenComm% C:\rngcapture\10Files20MB\%RANDOM%%RANDOM%%RANDOM% 20971520
if %var% EQU 10 goto end3
goto start3
:end3
echo var has reached %var%.
pause
GOTO MainMenu
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.