iT邦幫忙

0

如何寫個bat檔自動開啟網頁呢 ?

有20個網頁必須一直重複的開啟跟關閉(檔案名稱1,2,3,4...,20)
想用個bat檔來執行
每次執行時自動隨機開啟20個檔案中的10個
2分鐘後自動關閉所有網頁
懇請大大幫忙,,
謝謝,,!

看更多先前的討論...收起先前的討論...
slime iT邦大師 1 級 ‧ 2014-07-24 01:40:48 檢舉
批次檔只能開不能關....

建議考慮用 JavaScript 的 window.close() 處理.
蟹老闆 iT邦大師 1 級 ‧ 2014-07-24 10:55:15 檢舉
感覺像增加點擊率的樣子
讚讚讚
player iT邦大師 1 級 ‧ 2014-07-24 15:45:51 檢舉
為什麼老是每年都會看到這種問題?
是要洗瀏覽次數嗎?
蟹老闆 iT邦大師 1 級 ‧ 2014-07-24 17:50:49 檢舉
己寫好一個自動化的批次但騙廣告商還可以接受偷笑,如果吃虧的是廣告主那就不知是否該協助犯罪了。
蟹老闆 iT邦大師 1 級 ‧ 2014-07-24 17:58:21 檢舉
8*10=80 每二分鐘80個點擊
60/2=30 1小時可得30*80個點擊
2400*24=57600個點擊
算式怎麼來? 另一個問題來的
yioyo0619 iT邦新手 5 級 ‧ 2014-07-24 21:00:37 檢舉
關網頁嗎 ?
如果用
taskkill /im firefox.exe /f 呢
yioyo0619 iT邦新手 5 級 ‧ 2014-07-24 21:08:46 檢舉
是洗廣告無誤,,
蟹老闆 iT邦大師 1 級 ‧ 2014-07-25 00:21:57 檢舉
yioyo0619提到:
是洗廣告無誤
讚
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
7
Jesse HO
iT邦好手 1 級 ‧ 2014-07-25 00:01:16
最佳解答

當然準備 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

沒想太多的寫完
我想應該可以再簡潔

蟹老闆 iT邦大師 1 級 ‧ 2014-07-25 00:31:06 檢舉

還要考慮重複值的問題,另外PING -n 需考慮延遲的問題可以當作參考值,使用PATHPING -P 這是以時間為基準會較準確,如果有 sleep 就更方便了。

蟹老闆 iT邦大師 1 級 ‧ 2014-07-25 00:34:27 檢舉

不用再call bat 可以參考hon2006大的start 變成 start %rnd%.html

4
u8526425
iT邦大師 1 級 ‧ 2014-07-24 09:10:34
drmaster iT邦新手 5 級 ‧ 2017-06-07 08:48:12 檢舉

請問版主大大的需求,用Autohotkey怎麼寫?
感謝您

14
hon2006
iT邦大師 1 級 ‧ 2014-07-24 09:43:18

自動開啟網頁
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個
我數學不好要請高手解決

0
cyuwww
iT邦新手 2 級 ‧ 2014-07-29 08:49:08

驚
突然想到,
Jmeter 不知道能不能做到?

我要發表回答

立即登入回答