+ Post New Thread
Results 1 to 5 of 5
Windows Thread, copy folder to list of computers in Technical; Hi I am trying to copy a folder from a network share to a list of computers to c:\ I ...
  1. #1

    Join Date
    Feb 2008
    Posts
    343
    Thank Post
    52
    Thanked 3 Times in 3 Posts
    Rep Power
    14

    copy folder to list of computers

    Hi I am trying to copy a folder from a network share to a list of computers to c:\

    I have tried the code below just cant get it to work. Does anybody have a script


    @echo off
    set Source=
    set Target=c:\
    set List=machinelist.txt
    for /F %%a in ("%List%") do robocopy "%Source%" "\\%%a\%arget%"

    Thanks

  2. #2
    pleach85's Avatar
    Join Date
    Jan 2011
    Posts
    24
    Thank Post
    3
    Thanked 6 Times in 6 Posts
    Rep Power
    9
    Just change your target to C$\ and you've missed the T in Target when doing the robocopy.

    You might also want to look into using the /R and /W options in robocopy
    Code:
    /R:n :: number of Retries on failed copies: default 1 million.
    /W:n :: Wait time between retries: default is 30 seconds.
    If you leave them set as default you will be waiting a while if the computer you are copying to is turned off.

  3. #3

    sonofsanta's Avatar
    Join Date
    Dec 2009
    Location
    Lincolnshire, UK
    Posts
    5,123
    Thank Post
    911
    Thanked 1,511 Times in 1,032 Posts
    Blog Entries
    47
    Rep Power
    653
    Or do it with group policy preferences, a security group and item level targeting.

  4. #4

    Join Date
    Feb 2008
    Posts
    343
    Thank Post
    52
    Thanked 3 Times in 3 Posts
    Rep Power
    14
    Thanks for you reply. I still cant get the .bat to run. Does anybody know what I am doing wrong?

    Thanks
    @echo off
    set Source=\\domainname\NETLOGON\Desktop Shortcuts\test.lnk\
    set Target=C$\Users\Public\Desktop\
    set List=c:\Computers.txt\
    for /F %%a in ("%List%") do robocopy "%Source%" "\\%%a\%Target%"

    Pause

  5. #5


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,802
    Thank Post
    231
    Thanked 883 Times in 759 Posts
    Rep Power
    300
    be easie to deploy it as a startup script

    Code:
    copy "\\domainname\NETLOGON\Desktop Shortcuts\test.lnk" "C:\Users\Public\Desktop\test.lnk" /y
    also you have a \ after test.lnk

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 7
    Last Post: 25th April 2013, 04:10 PM
  2. Replies: 5
    Last Post: 30th January 2012, 03:03 PM
  3. Replies: 3
    Last Post: 3rd November 2011, 06:51 PM
  4. Replies: 3
    Last Post: 21st May 2010, 09:11 AM
  5. Best Way to copy folder to PC's
    By TechSupp in forum Windows
    Replies: 4
    Last Post: 15th May 2009, 04:51 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
  •