更改系统时间的批处理代码


@echo off
setlocal enabledelayedexpansion
set yearmin= 2017
set yearmax=2018
set mouthmin=1
set mouthmax=12
set datamin=1
set datamax=28
set hourmin=1
set hourmax=23
set secondmin=1
set secondmax=59
set /a mod1=!yearmax!-!yearmin!+1
set /a mod2=!mouthmax!-!mouthmin!+1
set /a mod3=!datamax!-!datamin!+1
set /a mod4=!hourmax!-!hourmin!+1
set /a mod5=!secondmax!-!secondmin!+1
set times=0

:start
for /l %%j in (1,1,10000) do (
set /a year=!random!%%!mod1!+!yearmin!
set /a mouth=!random!%%!mod2!+!mouthmin!
set /a data=!random!%%!mod3!+!datamin!
set /a hour=!random!%%!mod4!+!hourmin!
set /a second=!random!%%!mod5!+!secondmin!
set /a times=!times!+1
date !year!/!mouth!/!data! & time !hour!:!second!
cls
echo times=!times!
echo times=!times! > times.txt
echo year= !year! mouth=!mouth! data=!data! hour=!hour! second=!second!
ping -n 1 -w 500 0.0.0.1>nul
)
goto start



相关文档
最新文档