1. 程式人生 > >通過批處理變更系統時間

通過批處理變更系統時間

off AI windows 變更 fort details oca .net -a

最近因為要用fortify SCA 。網上唯一找到的一個破解版需要把系統時間調到2008年。

頻繁變更比較麻煩。所以上網查詢,寫了批處理。

改日期很簡單 date 2008/01/01 就可以。

恢復到Internet同步時間即現在時間比較麻煩。

需要先到註冊表 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config 下更改

MaxPosPhaseCorrectionMaxNegPhaseCorrection

單位為秒,所以十一年需要約60*60*24*366*11。我填大一下,十進制是4億。

win+R 然後regedit進註冊表慢慢找

技術分享圖片

恢復時間的命令是 w32tm /resync

可以在前面加一行 w32tm /config /manualpeerlist:"time.windows.com" /syncfromflags:manual /reliable:yes /update 設置時區等屬性

參考:

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

通過批處理變更系統時間