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

Discussion in 'Perl' started by Johnson Bruno, Oct 9, 2003.

  1. 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
    Johnson Bruno, Oct 9, 2003
    #1
    1. Advertising

  2. Johnson Bruno

    Synapse Guest

    "Johnson Bruno" <> wrote in message
    news:...
    > 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
    Synapse, Oct 9, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wet Basement
    Replies:
    1
    Views:
    2,518
    BobMonk
    Jul 15, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,253
    Michael Borgwardt
    May 30, 2004
  3. Keith Cochrane
    Replies:
    2
    Views:
    614
    Keith Cochrane
    Aug 6, 2006
  4. Ro
    Replies:
    3
    Views:
    372
    Lawrence Kirby
    Jan 26, 2005
  5. Petterson Mikael

    Execute another perl script from my perl script

    Petterson Mikael, Jan 5, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    139
    Paul Lalli
    Jan 5, 2005
Loading...

Share This Page