pawcio has asked for the wisdom of the Perl Monks concerning the following question:

hello again

I can't find the way to copy directory recursively to number of remote machins. \\\\$machinename\\c$\\$dirname

May I ask for example please :)

Regards

  • Comment on Win32-NetResources copy directory to number of remote machines

Replies are listed 'Best First'.
Re: Win32-NetResources copy directory to number of remote machines
by eyepopslikeamosquito (Archbishop) on Oct 08, 2005 at 12:29 UTC

    A real simple way is to set up file shares on each of the remote computers, then run a Perl script to copy files to these shares. Another way is to use ftp servers in conjuction with the standard Perl Net::FTP module. Yet another approach is to use Microsoft SFU (Services for Unix) in conjunction with the standard Windows rcp command. Or set up a common network drive and run a process remotely on each computer to copy from that network drive ... or (perhaps better) don't copy at all, just use the common network drive.

    If you give us some more background on what you are trying to achieve and why, we will be better able to help.

    Update: If you are just asking how to copy files recursively from one directory to another, you might use the core File::Copy/File::Find modules or the CPAN File::NCopy module or run the Windows xcopy command or the more sophisticated RoboCopy utility from Windows Resource Kit (similar to Unix rsync utility). If you want some sample code, the convention here is that you should first show us what you have tried so far. Do not expect to be spoon fed without first putting in a genuine effort to solve the problem yourself.

Re: Win32-NetResources copy directory to number of remote machines
by Jenda (Abbot) on Oct 09, 2005 at 13:00 UTC

    I think you are looking at a wrong module. Have a look at Win32::FileOp.

    Jenda
    XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented.

      THX for Help chaps.

      Win32-NetResources is not a good way to do it indeed. Unfortunately I have to quick sort out it using BATCH.

      FOR %%A IN (comp1 comp2 comp3) DO ( XCOPY /E /V C:\SRC \\%%A\C$\DST )

      But still thinking about writing my own small deployment perl script.