+ Post New Thread
Results 1 to 2 of 2
Windows Thread, Copy a file to many destination folders. in Technical; I have a file that i need copied to many destination folders (redirected desktop's) and a startup script hasn't worked. ...
  1. #1
    fooby's Avatar
    Join Date
    Dec 2005
    Posts
    351
    Thank Post
    0
    Thanked 5 Times in 4 Posts
    Rep Power
    19

    Copy a file to many destination folders.

    I have a file that i need copied to many destination folders (redirected desktop's) and a startup script hasn't worked.

    Is there some application? or a script (foreach / for next loop?) that anyone has used that would work?

    thanks

    fooby

  2. #2
    fooby's Avatar
    Join Date
    Dec 2005
    Posts
    351
    Thank Post
    0
    Thanked 5 Times in 4 Posts
    Rep Power
    19

    Re: Copy a file to many destination folders.

    Sorted.

    part1.cmd
    Code:
    IF (%1)==() GOTO usage
    dir %1 /A:D /B > dir.txt
    for /F "delims= tokens=1" %%a in (dir.txt) do call part2.cmd %1 %%a
    GOTO End
    :usage
    ECHO Usage: part1.cmd 
    :End
    part2.cmd
    Code:
    if %2==bytes GOTO :End
    copy "c:\folder\item.exe" %1\%2\ /Y
    :End

    Usage.

    1. Place carefully on C:\temp (or whatever folder)
    2. Modify part2.cmd (what you want to get done to each object)
    3. C:\temp> part1 h:\staffdesktops

    Code:
    C:\temp>call part2.cmd h:\user1
    C:\temp>if user1 == bytes GOTO :End
    C:\temp>copy "c:\temp\item.exe" h:\user1\ /Y
            1 file(s) copied.
    
    C:\temp>call part2.cmd h:\user2
    C:\temp>if user2 == bytes GOTO :End
    C:\temp>copy "c:\temp\item.exe" h:\user2\ /Y
            1 file(s) copied.
    fooby

    Keywords: One to many, many destinations, many folders

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. Replies: 5
    Last Post: 27th April 2007, 06:30 PM
  3. Replies: 4
    Last Post: 25th December 2006, 09:15 PM
  4. Replies: 4
    Last Post: 23rd March 2006, 06:27 AM
  5. Replies: 3
    Last Post: 1st March 2006, 12:08 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
  •