Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: copy to multiple computers...but differently?  (Read 7819 times)

0 Members and 1 Guest are viewing this topic.

TheHoFL

    Topic Starter


    Intermediate

    Thanked: 5
    copy to multiple computers...but differently?
    « on: June 19, 2009, 10:01:58 AM »
    I know how to copy files to multiple computers, but i am curious if i can have files copied to multiple computer in a better way...maybe have the BAT file pull the computer names from a list or something, so the BAT file is a bit more easily read for other co-worker that may not work with BATs that ofthen.

    Currently i am using the popular method of having many lines. But i have many computers i need to copy and was curious. Thanks for the input!

    Currently using
    Code: [Select]
    copy /Y "\\Server\share\file" \\client1\documents and settings\profile\Desktop
    copy /Y "\\Server\share\file" \\client2\documents and settings\profile\Desktop
    copy /Y "\\Server\share\file" \\client3\documents and settings\profile\Desktop
    copy /Y "\\Server\share\file" \\client4\documents and settings\profile\Desktop
    copy /Y "\\Server\share\file" \\client5\documents and settings\profile\Desktop
    etc...
    All your dreams can come true if you have the courage to pursue them.  - Walt Disney

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: copy to multiple computers...but differently?
    « Reply #1 on: June 19, 2009, 12:03:14 PM »
    You could simplify by using NET VIEW and write that to a file such as NetworkedComputers.list ( to build a list ) by running NET VIEW>>NetworkedComputers.list then input that list into an array and then have the command go through each and every networked system on the list..

    Running this command will write the output of NET VIEW to NetworkedComputers.list file  ( Notation on the domain could be an issue with this list when only wanting names so you might have to go into this file and remove notation.)

    ""Warning without modifying this list it will go to ALL Systems and SERVERS that are part of the domain including the system that the batch is triggered from with the next portion in which you are copying files""

    If you want to exclude the servers from the run you can add IF statements to test for known server names or manually edit the .list file so that it doesnt hit those systems from a single system that would run this batch server side.

    This list created by:

    Code: [Select]
    NET VIEW>>NetworkedComputers.list   

    Only needs to be run once to build your list.

    Then your batch will interact with this list, and all you need to do is edit the list instead of the actual batch file to add or remove systems to get the files.

    If you are unsure how to read in from list into array etc let us know. If I had more time I'd put an example together but lunch break is over with and time to get back to IT.

    Here is a quick peek at a sampleof it run at my network: You will need to condition (strip junk out of it) so that all you have it the list of computer names. Merchandiser below being a notation on the domain. And you will want to strip/remove all \\ and Server Name and Remark and ----------- in order to have clean names that can be passed into the batch arguments and function properly.

    Quote
    Server Name            Remark

    -------------------------------------------------------------------------------
    \\ACCT1                                                                       
    \\ADAST                                                                       
    \\ADETNARAID                                                                   
    \\ADHANDL360                                                                   
    \\ADLEBRAID                                                                   
    \\ADLYMERAID                                                                   
    \\ADMINASST                                                                   
    \\ASTREET2003                                                                 
    \\ASTREETVLI8                                                                 
    \\BBXP                                                                         
    \\BONNIEXP                                                                     
    \\CAERDYDD                                                                     
    \\CATERXP1                                                                     
    \\CATERXP5                                                                     
    \\CATERXP6                                                                     
    \\CATERXP7                                                                     
    \\CATERXP8                                                                     
    \\CHEFXP                                                                       
    \\CHICMERC             Merchandiser