Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...