469,592 Members | 2,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

How do the perl script get date and time of another computer

Hi,
I want my perl script to get date and time of another computer
which is connected by LAN.The OS is Win 2000.

I tried this , but did not work.
$file="\\\\P418\\test\\get.cmd";
@output=qw{$file};
p418 is system name. test is a shared directory and get.cmd has "Date
/t" in the first line and "time /t" in the second line.

Thanks for your help
Bruno
Jul 19 '05 #1
1 5878
"Johnson Bruno" <jo***********@tfn.com> wrote in message
news:94*************************@posting.google.co m...
Hi,
I want my perl script to get date and time of another computer
which is connected by LAN.The OS is Win 2000.

I tried this , but did not work.
$file="\\\\P418\\test\\get.cmd";
@output=qw{$file};
p418 is system name. test is a shared directory and get.cmd has "Date
/t" in the first line and "time /t" in the second line.

Thanks for your help
Bruno


What platform will the script be running on? If it's a *nix, then you'll
need to samba mount the shared directory before reading; the short
"//server/foo/bar.baz" format won't work. If it's a windows machine, try
forward instaed of backslashes in the network name, or try the Win32::*
series of modules to see if there's a way to mount the share locally, then
just disconnect it when you're done.

The easiest way, if you have admin on the server, is to install the basic
network services package, which includes the time daemon. Then you can just
use a socket to connect and read the time there.

Regards,
RyMon
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

52 posts views Thread by Olivier Scalbert | last post: by
3 posts views Thread by DGG | last post: by
reply views Thread by Kirt Loki Dankmyer | last post: by
6 posts views Thread by surfivor | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.