+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, script to copy files to machines in Coding and Web Development; i made this a few years ago to copy the ucas software to computers but it had to cope with ...
  1. #1
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,524
    Thank Post
    106
    Thanked 88 Times in 74 Posts
    Blog Entries
    46
    Rep Power
    40

    script to copy files to machines

    i made this a few years ago to copy the ucas software to computers but it had to cope with the possibility that machines might be off. It loops keeping track of machines which are unreachable and retrying them. shouldnt be too hard to change it for other files.

    Code:
    @echo off
    set filenum=1
    if exist off1.txt del off1.txt
    copy complist.txt off1.txt
    
    
    :loop
    
    set /a file1=%filenum%
    set /a file2=%filenum%+1
    echo off%file1%.txt and off%file2%.txt
    
    for /f %%a in (off%file1%.txt) do ( 
    	if not exist "\\%%a\c$\" echo %%a off && echo %%a >> off%file2%.txt
    	if exist "\\%%a\c$\" ( 
    	echo go %%a
    	md "\\%%a\c$\program files\eas2005"
    	copy k:\eas2005\wssetup\client\*.* "\\%%a\c$\program files\eas2005\"
    	copy k:\eas2005\wssetup\eas05a32.ini "\\%%a\c$\winnt" 
    	copy K:\eas2005\WSSETUP\icon\*.lnk "\\%%a\c$\icons")
     )
    
    
    
    set filenum=%file2%
    del off%file1%.txt
    
    goto loop

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: script to copy files to machines

    You should replace the 'copy's with 'robocopy's

SHARE:
+ Post New Thread

Similar Threads

  1. Mass Copy of Files and Folders
    By originofsymmetry in forum Scripts
    Replies: 6
    Last Post: 2nd October 2007, 12:16 PM
  2. Failed to copy files from CD
    By Dos_Box in forum Learning Network Manager
    Replies: 13
    Last Post: 12th April 2007, 10:42 AM
  3. Replies: 19
    Last Post: 20th June 2006, 03:53 PM
  4. Replies: 7
    Last Post: 19th May 2006, 11:53 AM
  5. Replies: 6
    Last Post: 20th October 2005, 06:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •