itgeek Posted October 11, 2013 Posted October 11, 2013 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
pleach85 Posted October 11, 2013 Posted October 11, 2013 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 /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.
sonofsanta Posted October 11, 2013 Posted October 11, 2013 Or do it with group policy preferences, a security group and item level targeting.
itgeek Posted October 15, 2013 Author Posted October 15, 2013 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
sted Posted October 15, 2013 Posted October 15, 2013 be easie to deploy it as a startup script copy "\\domainname\NETLOGON\Desktop Shortcuts\test.lnk" "C:\Users\Public\Desktop\test.lnk" /y also you have a \ after test.lnk
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now