33 lignes
1,1 Kio
Batchfile
33 lignes
1,1 Kio
Batchfile
|
@echo off
|
||
|
:: Date generator for Mikrotik
|
||
|
:: Generate a console command based on computer's date and time
|
||
|
:: Command format is for RouterOS up to 7.9.2
|
||
|
:loop
|
||
|
cls
|
||
|
set date-day=%date:~0,2%
|
||
|
set date-year=%date:~6,4%
|
||
|
set time-hour=%time:~0,2%
|
||
|
set time-min=%time:~3,2%
|
||
|
set time-sec=%time:~6,2%
|
||
|
:: convert month into 3 letters shit
|
||
|
set month-num=%date:~3,2%
|
||
|
if %month-num%==01 set date-month=jan
|
||
|
if %month-num%==02 set date-month=feb
|
||
|
if %month-num%==03 set date-month=mar
|
||
|
if %month-num%==04 set date-month=apr
|
||
|
if %month-num%==05 set date-month=may
|
||
|
if %month-num%==06 set date-month=jun
|
||
|
if %month-num%==07 set date-month=jul
|
||
|
if %month-num%==08 set date-month=aug
|
||
|
if %month-num%==09 set date-month=sep
|
||
|
if %month-num%==10 set date-month=oct
|
||
|
if %month-num%==11 set date-month=nov
|
||
|
if %month-num%==12 set date-month=dec
|
||
|
|
||
|
echo.
|
||
|
echo /system clock set date=%date-month%/%date-day%/%date-year% time=%time-hour%:%time-min%:%time-sec% time-zone-name=Europe/Paris;
|
||
|
echo /system clock set date=%date-month%/%date-day%/%date-year% time=%time-hour%:%time-min%:%time-sec% time-zone-name=Europe/Paris; |clip
|
||
|
echo (copied in clipboard)
|
||
|
echo.
|
||
|
pause
|
||
|
goto loop
|