利用批處理BAT生成隨機(jī)數(shù)實(shí)現(xiàn)隨機(jī)網(wǎng)站內(nèi)容
更新時間:2013年05月06日 23:07:21 作者:
今天想用批處理(BAT)的方式隨機(jī)打開網(wǎng)站某頁面,基目的是刷網(wǎng)站的PV
%RANDOM% 返回 0 到 32767 之間的任意十進(jìn)制數(shù)字。比如說想生成0-100的隨機(jī)數(shù)就是對101取余數(shù)就可以了。格式是:set num=%RANDOM%%%100
下面是我的實(shí)例代碼:
@echo off
set s=10000
set g=10
cls
set count=0
:loop
set /a num=%random%%%%s%+1
if not defined num%num% (
set num%num%=%num%
set /a count1
call explorer.exe http://www.dhdzp.com/article/%%num%%.html
)
if %count% lss %g% goto loop
下面是我的實(shí)例代碼:
復(fù)制代碼 代碼如下:
@echo off
set s=10000
set g=10
cls
set count=0
:loop
set /a num=%random%%%%s%+1
if not defined num%num% (
set num%num%=%num%
set /a count1
call explorer.exe http://www.dhdzp.com/article/%%num%%.html
)
if %count% lss %g% goto loop
相關(guān)文章
批處理處理文本文件去重復(fù)實(shí)現(xiàn)代碼
這篇文章主要介紹了批處理處理文本文件去重復(fù)實(shí)現(xiàn)代碼,需要的朋友可以參考下2016-11-11
DOS?批處理如何使用變量的延遲擴(kuò)展(講解簡約版)
使用變量延遲擴(kuò)展之前,需要先開啟cmd.exe的變量延遲展開特性<BR>獲取延遲變量值,變量名兩邊需要加!,而不是%,這個得注意注意下2024-06-06

