Several random numbers generated by VBS are written into one Txt

Time:2022-7-6

Copy codeThe code is as follows:


Set a=WScript.CreateObject(“WScript.Shell”)
a.Run “notepad”
‘open Notepad
do
Randomize
x= Int((40 * Rnd) + 1)
‘generate a random number of 1~40 and assign it to X
WScript.Sleep 1000
a.SendKeys x&”,”
‘analog keyboard, output x
N=n+1 ‘accumulator
if n=10 then wscript. Quit ‘if the accumulator n is 10, the script will be pushed out
loop
‘save as VBS to see the results