有20個網頁必須一直重複的開啟跟關閉(檔案名稱1,2,3,4...,20)
想用個bat檔來執行
每次執行時自動隨機開啟20個檔案中的10個
2分鐘後自動關閉所有網頁
懇請大大幫忙,,
謝謝,,!
當然準備 1~20.BAT
<pre class="c" name="code">
@echo off
set min=1
set max=20
set var=%3
set /A rnd=(%max-%min+1)*%random%/32768+%min
REM #1 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #2 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #3 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #4 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #5 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #6 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #7 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #8 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #9 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM #10 TIME
ping -n 1 127.0.0.1 > NUL
set /A rnd=(20-1+1)*%random%/32768+1
call %rnd%.bat
REM WAIT 120 sec. (2 min.)
ping -n 120 127.0.0.1 > NUL
REM KILL ALL IEXPLORE PROCESS
taskkill /im iexplore.exe /f
沒想太多的寫完
我想應該可以再簡潔
自動開啟網頁
start "c:\Program Files\Internet Explorer\iexplore.exe" http://www.yahoo.com.tw
sleep 120
taskkill /im iexplore.exe /f
隨機執行批次檔
http://www.etcwiki.org/wiki/Using_.bat_files_for_random_actions
自動隨機開啟20個檔案中的10個
我數學不好要請高手解決