执行命令:

net time "\OhterComputerName" /set /yes 可以保证名称为OhterComputerName 的计算机与本机时间同步。

Public Sub SyncTime()

Dim thecomp As String

Dim theshell As String

thecomp = "\computername"

theshell = "net time " & Chr(34) & thecomp & Chr(34) & " /set /yes"

x = Shell(theshell)

End Sub