首页 > 代码库 > Windows 添加计划任务 每隔一定时间执行指定批处理脚本

Windows 添加计划任务 每隔一定时间执行指定批处理脚本

schtasks /create /sc minute /mo 20 /tn "TestBatch" /tr C:/TestBatch.bat

TestBatch.bat

echo "---------------------批处理开始------------------------------"
ping sz.tencent.com > D:/a.txt
ping sz1.tencent.com >> D:a.txt
ping sz2.tencent.com >> D:/a.txt
ping sz3.tencent.com >> D:/a.txt
ping sz4.tencent.com >> D:/a.txt
ping sz5.tencent.com >> D:/a.txt
ping sz6.tencent.com >> D:/a.txt
ping sz7.tencent.com >> D:/a.txt
exit