Jump to content

Recommended Posts

Posted

Need some help writing a script to copy a folder (with sub contents) to multiple remote machines.

 

i have done it for files but how do you to it for folders help!!

@Rem simple copy script for Windows Command Interpreter (cmd.exe) @echo Read in each hostname entry in the file hostnames.txt amd copy the local file to the c$ of each hostname

 

FOR /F %%i in (hostnames.txt) do copy name.bmp \\%%i\"c$\Program Files\"

Posted

If you have access to the server, you could do this with Group policy.

 

Computer Preferances > files [i think]

 

Put the source folder [on a shared drive] as \\server\share\folder\* and set the target as "%programFiles%\", I also usually set it as "apply once".

Posted

i was trying to use cmd instead

getting the names from a txt file for the machines, then copy the folder to c:\Windows\System32\oobe

 

somethng like this ( its wrong at the moment)

FOR /F %%D in (hostnames.txt) do Xcopy /E / Y "c:\Info*.*" "c$\Windows\System32\oobe\" \\%%D

 

i know you can to it like this

 

Xcopy /E /Y "c:\MyProject\Sample*.*" "\Computer1\Sample\"

Xcopy /E /Y "c:\MyProject\Sample*.*" "\Computer2\Sample\"

Xcopy /E /Y "c:\MyProject\Sample*.*" "\Computer3\Sample\"

Xcopy /E /Y "c:\MyProject\Sample*.*" "\Computer4\Sample\"

 

but that will take to long, need it to get the names from a text file.

Posted

If you run it in CMD what happens?

 

Are there any error messages?

 

I'm guessing it's a startup script, where is the source file located?

 

If you change "C:\Windows\System32\oobe\" to "%windir%\system32\oobe\" does it work?

Posted (edited)

no i dont :(

 

i would like to write a script that way i can use it for other things

Edited by er22

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...