#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Help finishing script


    Hi all. I wrote this command:

    Code:
    C:\> for /f %s in (computers.txt) do @robocopy \\server01\files\copyme \\%s\c$\localdir /S

    To copy a directory from a server to multiple computers in a text file. What I want to do is make it a script that first checks the local machine for the folder, copies it to a new name, then overwrites the existing one. If anyone can help with this it would be awesome

    thanks.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    1st attempt


    So this is what I have so far, but I dont think it is working.

    Code:
    for /F %s in (computers.txt) do
    
    if exists \\%s\c$\program files\medrite-xl\Templates(
    
    	ren \\%s\c$\program files\medrite-xl\Templates \\%s\c$\program files\medrite-xl\Templates.OLD;
    )
    
    @robocopy \\serverName\share\medrite-xl\templates \\%s\c$\program files\medrite-xl\Templates
    Am I heading the right direction here?

    Thanks.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    99
    Rep Power
    157
    why do you think its not working?

    what happens when you run it?

    if rename works what happens if you just rename...

    what happens if you rename a file that is not present...

    if its not fatal is it faster...

    I always just do if it has no detrimental effect...

    questions or the wrong question always slows the process up!

IMN logo majestic logo threadwatch logo seochat tools logo