In a Windows NT domain, other than logging on to the front end via VNC, is there anyway to change a WinXP or Win2K workstations time?
Announcement
Collapse
No announcement yet.
Change workstation time
Collapse
X
-
Re: Change workstation time
This little snippet will set the remote system's time to that of the IP address you specify.
' ---------- start here ---------
On Error Resume Next 'turn off error checking
Dim wmi, process, startupInfo, cmd
Dim timeserver : timeserver = "1.2.3.4"
'Get the WMI reference
Set wmi = getobject("winmgmts:{(SystemTime)}!//" & sTarget)
Set process = wmi.get("win32_process")
Set startupInfo = wmi.get("win32_processstartup")
'set additional parameters
startupInfo.showWindow = 0 '0=hidden 1=normal 7=minnoactivate
'set the command to Execute
cmd = "net time \" & timeserver & " /set /y"
' do it!
process.create cmd,,startupInfo
On Error Goto 0 'reset error checking
' --------- end here ---------
Hope this helps!
Joel
Comment