使用批处理脚本轮询txt文件内链接
以下是一个使用批处理脚本轮询txt文件内链接的示例:
@echo off
setlocal enabledelayedexpansion
REM 设置要轮询的txt文件路径
set 'txt_file=path\to\your\file.txt'
REM 设置轮询间隔(以毫秒为单位)
set 'polling_interval=5000'
REM 创建一个存储链接的数组
set 'links[0]=http://example.com/link1'
set 'links[1]=http://example.com/link2'
set 'links[2]=http://example.com/link3'
REM 获取txt文件中的链接,将其添加到数组中
for /f "tokens=*" %%a in (%txt_file%) do (
set /a index+=1
set 'links[!index!]=%%a'
)
REM 开始轮询链接
:polling
for /l %%i in (0,1,%index%) do (
set 'link=!links[%%i]!'
REM 执行你希望在每个链接上执行的操作,例如打开链接
start "" '!link!'
)
REM 休眠指定的轮询间隔
ping -n 1 -w %polling_interval% 127.0.0.1 >nul
REM 继续轮询链接
goto polling
请将path\to\your\file.txt
替换为你要轮询的txt文件的实际路径。你可以根据需要修改polling_interval
变量来设置轮询间隔(以毫秒为单位)。脚本将在每个链接上执行指定的操作,例如使用start
命令打开链接。你可以根据需要修改执行操作的部分。

原文地址: http://www.cveoy.top/t/topic/Vam 著作权归作者所有。请勿转载和采集!