I talked to others about Y2K38 that day, so I thought of a prank: I used VBS to change the system time after 03:14:07 on January 1, January 19, 2038, so that some programs dependent on Unix timestamps may have problems. So how can we use VBS to modify the system time?
The simplest and least technical method is to call the date and time commands of cmd:Copy codeThe Code is as follows: 'author: Demon
'Website: http://demon.tw
'Date: 2011/4/27
Dim WshShell
Set WshShell = CreateObject ("wscript. Shell ")
WshShell. Run "cmd.exe/c date 2038-01-19", 0
WshShell. Run "cmd.exe/c time 3:14:08", 0
A more technical method is to use the SetDateTime method of the WMI Win32_OperatingSystem class:Copy codeThe Code is as follows: 'author: Demon
'Website: http://demon.tw
'Date: 2011/4/27
DtmNewDateTime = "20380119031408.000000 + 480" 'utc time
StrComputer = "."
Set ob1_miservice = GetObject ("winmgmts: {(Systemtime) }\\" & strComputer & "\ root \ cimv2 ")
Set colOSes = ob1_miservice. ExecQuery ("Select * From Win32_OperatingSystem ")
For Each objOS In colOSes
ObjOS. SetDateTime dtmNewDateTime
Next
Windows 7 requires administrator privileges to enable UAC to modify the time.
Reference link:Hey, Scripting Guy! How Can I Set the Date and Time on a Computer?
From: http://demon.tw/programming/vbs-modify-system-time.html