Hi,
I'm looking for a script that when run from a batch or script file, will set the computers date and time to a current date and time after looking it up using a NTP Server service.
I know there are probably better places to post this, but I also know that the guys here are extremely smart too and probably has the answer.
I've tried
1.
w32tm /config /manualpeerlist:128.138.141.172 /syncfromflags:manual
w32tm /update
w32tm /resync
and it reports the dte difference is too big.
2.
rem w32tm /config /syncfromflags:manual /manualpeerlist:0.time.windows.com,1.time-nw.nist.gov,2.time-a.nist.gov,3.time.nist.gov
3.
Here is the entire batch file I've been playing with and still no glory.
Any ideas?
Stanley
I'm looking for a script that when run from a batch or script file, will set the computers date and time to a current date and time after looking it up using a NTP Server service.
I know there are probably better places to post this, but I also know that the guys here are extremely smart too and probably has the answer.
I've tried
1.
w32tm /config /manualpeerlist:128.138.141.172 /syncfromflags:manual
w32tm /update
w32tm /resync
and it reports the dte difference is too big.
2.
rem w32tm /config /syncfromflags:manual /manualpeerlist:0.time.windows.com,1.time-nw.nist.gov,2.time-a.nist.gov,3.time.nist.gov
3.
Here is the entire batch file I've been playing with and still no glory.
Code:
@echo off
date 1/16/2015
pause
rem The pauses are here so I can watch the date change...
rem SET TODAY=%date:~0,2%-%date:~4,2%-%date:~7,4%
rem echo %today%
rem time 15:00
date 11/03/2015
pause
rem date 1/16/2015
REM setting date back to an older date
rem DATE 11/03/2011
rem (echo start "" "C:\path to my program\myprogram.exe"
rem echo del ^%^0) >tempstart.bat
rem start "" tempstart.bat
REM Changing date back to todays date
rem ping 1.1.1.1 -n 1 -w 4000>nul
rem DATE %TODAY%
w32tm /config /manualpeerlist:128.138.141.172 /syncfromflags:manual
w32tm /update
w32tm /resync
rem w32tm /config /syncfromflags:manual /manualpeerlist:0.time.windows.com,1.time-nw.nist.gov,2.time-a.nist.gov,3.time.nist.gov
pause
Any ideas?
Stanley