| View previous topic :: View next topic |
| Author |
Message |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Feb 16, 2003 2:11 am Post subject: Set clock or get time from LAN... |
|
|
Hey guys,
I'd like to synchronize all my LAN PCs with my machine. Am currently
using a VDS prog (from my machine) that creates a batch file on the
remote desktop. This file sets the remote PC clock to my time/date
settings, but it must be run from the remote machine immediately to
be accurate within a few seconds.
I'd like to either....
1. Retrieve my computer time from the remote machine without
anything running on my computer (considered constantly updating
a text file that the user can access, but don't really wanna write to
my hard drive every second...).
2. Set the remote computer clock directly from my machine (have
had no luck with this, all attempts set my clock instead of the remote.
Running the remote batch file from my machine still sets my clock...).
Any ideas?
Thanks, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Feb 16, 2003 4:03 am Post subject: |
|
|
Got an email from Larry H informing me about using the
"net time" command from the remote computer. I put it
in this simple VDS prog and it works perfect.
| Code: |
rem -- computer name to synchronize time with --
%%name = "Mac"
LIST CREATE, 1
LIST FILELIST, 1, "\\"%%name"\C", D
if @item(1)
RUNZ command /c net time \\%%name /set /yes
else
INFO %%name is NOT on LAN...@tab()
end
:CLOSE
EXIT
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
MarkTrubo Contributor


Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
Posted: Sun Feb 16, 2003 11:58 am Post subject: |
|
|
Just test this program in the situation when the computer you are getting the time from is not available. We used to use some program that did something like this, but when the target you were getting the time from was not available, the computers all set their year to 2036.
I see you had a provision for the computer not being on the Lan, but I'm saying if it saw the computer but for some reason could not get the time.
That caused all sorts of trouble. Don't know why it was always 2036 when that happened though. |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 17, 2003 12:08 am Post subject: |
|
|
Hey Mark,
I've used this method before - it tries to get a list of dirs
from the target computer's C drive. If it can't get the list,
the comp is unavailable for whatever reason. So far, if it
does get the list, all remote functions work OK. I do have
all drives shared though - if ya only have shared folders,
it might hafta be modified.
I came up with this method when I was playing with a LAN
chat program:
http://www.vdsworld.com/forum/viewtopic.php?t=494
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
MarkTrubo Contributor


Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
Posted: Mon Feb 17, 2003 12:31 pm Post subject: |
|
|
Cool -- I will try it and see if we ever have a problem and report back. Well, of course I can't test it in the office until we can go in -- just a little bit of snow happening in New York right now.  |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Tue Feb 18, 2003 3:08 pm Post subject: |
|
|
Yeah... a little bit of snow...  |
|
| Back to top |
|
 |
|