"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