|Thanks for the clarification Wahine, I was confused at how to utilize the %random% variable - My batch file skills are less than admirable. |
That script works perfectly, and with some help & tweaking I've gotten it to both find the number of lines in my text file and open the line, but now I'm struggling because whenever I rerun the batch on my txt file the line it decides to open is always a short number of lines ahead of the last line it opened.
For example, if it opens line 11024, the next time i run it it opens line 11161.
This is the code:
@echo off & setlocal
for /f %%C in ('Find /V /C "" ^< "%txtfile%"') do set Count=%%C
set /a file=%random% %% %lines%+1
if %file% lss 10 set file= %file%
echo File #%file% will be selected
for /l %%i in (1 1 %file%) do set /p "ln="
start "" "%ln%"