I am trying to make a batch file that will create a random four digit number (eg. 8472) and then edit a registry string with this number.
Here is where I am and it's not working. As you can see there is already a string in the registry I need this script to change the last four digits each time it is run. Where am I going wrong? Also pause is not working my cmd windows close as fast as they open.
echo -----------------------------------
echo --------------Testing--------------
echo -----------------------------------
:beg
set rnd %random%
if %rnd% GTR 9999 goto beg
if %rnd% LSS 1111 goto beg
REGEDIT4
; @ECHO OFF
; CLS
; REGEDIT.EXE /S "%~f0"
; EXIT
[HKEY_LOCAL_MACHINE\Software\Test]
"Test"="{12345678-12A1-123B-A12C-123A123B%rnd%}"