I made a batch file, which changes the date of windows, however I want to create another file that when I run it, it retrieves the updated date. How to proceed?
I made a batch file, which changes the date of windows, however I want to create another file that when I run it, it retrieves the updated date. How to proceed?
Save the date is possible, but it's best to sync the date / time via the internet :
@echo off & color 0a && setlocal enableextensions enabledelayedexpansion
tzutil /s "E. South America Standard Time"
w32tm /query /status 2>nul >nul
if not !errorlevel! == 0 (
w32tm /register && net start w32time
w32tm /config /manualpeerlist:a.ntp.br /syncfromflags:manual /reliable:yes /update
w32tm /resync /force /nowait && net stop w32time
w32tm /unregister
) else (
w32tm /config /manualpeerlist:a.ntp.br /syncfromflags:manual /reliable:yes /update
w32tm /resync /force /nowait && net stop w32time
)