@echo off
setlocal EnableDelayedExpansion
rem You may define next value from a parameter, if you wish
set number=10
rem Define the array of game ID's
set n=0
for %%a in (233720 113200 219640 2500 204300 49600 107100 730 550 35700
92300 217690 620 8930 57690 24240 3830 35140 200260 4920
245070 204360 46750 300 18500 63800 214340 25800 8500 212680
4000 41800 220
) do (
set /A n+=1
set gameID[!n!]=%%a
)
rem Select %number% non-duplicated random elements from previous array and run such Steam games
for /L %%n in (1,1,%number%) do (
rem Get the index of a random element
call :getRandomElem i=
rem Run such game
for /F %%i in ("!i!") do start sam.game.exe !gameID[%%i]!
rem Put a zero in such element
set gameID[!i!]=0
)
goto :EOF
rem Get the index of a random element greater than 0 from gameID array
:getRandomElem i=
set /A i = n * %random% / 32768 + 1
if !gameID[%i%]! equ 0 goto getRandomElem
exit /B
You may review a detailed explanation on array management in Batch files at this post.