set %RANDOM% for timeout command
Posted: 08 Apr 2019 10:22
Goodevening programmers,
here I have a trouble with a .bat file I'm working on:
I want do make an action (for example: start notepad.exe) over and over with a "random" timeout with the following code:
Now I need to "set" the random number, for example, > 1 and < 100, so I tryed using the following code:
This returns me error. What can I do to make it work? Thanks everybody
here I have a trouble with a .bat file I'm working on:
I want do make an action (for example: start notepad.exe) over and over with a "random" timeout with the following code:
Code: Select all
:label
start notepad.exe
timeout %RANDOM%
goto label
Code: Select all
SET /A test=%RANDOM%*100/32768+1
:label
start notepad.exe
timeout test
goto label