通过批处理变更系统时间

最近因为要用fortify SCA 。网上唯一找到的一个破解版需要把系统时间调到2008年。

频繁变更比较麻烦。所以上网查询,写了批处理。

改日期很简单 date 2008/01/01 就可以。

恢复到Internet同步时间即现在时间比较麻烦。

需要先到注册表  HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig 下更改

MaxPosPhaseCorrectionMaxNegPhaseCorrection 

单位为秒,所以十一年需要约60*60*24*366*11。我填大一下,十进制是4亿。

win+R  然后regedit进注册表慢慢找

恢复时间的命令是   w32tm /resync

有时需要根据情况在前面加

 //设置时区等属性

 w32tm /config /manualpeerlist:"time.windows.com" /syncfromflags:manual /reliable:yes /update

//重启服务

net stop w32time 

net start w32time

参考:

https://blog.csdn.net/crazycoder2010/article/details/7213081

https://support.microsoft.com/zh-cn/help/884776/how-to-configure-the-windows-time-service-against-a-large-time-offset

https://blog.csdn.net/emaste_r/article/details/7974370

原文地址:https://www.cnblogs.com/wangkaipeng/p/8642255.html