1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Robocopy - All Folders on a network computer?

Discussion in 'Networking' started by herhubby86, Jun 16, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. herhubby86

    herhubby86 Thread Starter

    Joined:
    Mar 30, 2008
    Messages:
    27
    I am trying to use robocopy to backup files over our home network, from my daughters computer, to my backup drive. Unfortunately, she is sharing about 20 folders on her computer, and the only way I can get it to work is to write a separate command for each folder:

    robocopy "\\CHRISTINE\Music" "K:\Christine\Music" /mir /z
    robocopy "\\CHRISTINE\Photos" "K:\Christine\Photos" /mir /z
    robocopy "\\CHRISTINE\Video" "K:\Christine\Video" /mir /z
    etc...

    I tried entering just "\\CHRISTINE" but this results in a path not found error.

    Is there a way to get Robocopy to locate all the shared folders on her computer automatically (in case she shares new folders without my knowledge)?

    Thanks,

    Anthony
     
  2. Couriant

    Couriant Trusted Advisor

    Joined:
    Mar 26, 2002
    Messages:
    32,115
    First Name:
    James
    Not familar with Robocopy but looking at the switches perhaps doing /s or /e help? It may not since when you doe \\CHRISTINE\ it will show the shared resources and may not like it.

    if not, try \\CHRISTINE\c$\Document and Settings\<name>\My Documents /e /z

    I see /mir is the same as /e & /purge... so whatever you need.

    <name> would be her login or whatever name was used.

    c$ will not work if you don't have admin rights to the computer. also I assume that the windows directories are on the C: drive. If not, then which it to whichever drive it's on (ie d$ for d drive, e$ for e drive etc)

    If the command does not work try \\CHRISTINE\c$ in a windows explorer screen or Run menu to see if you access the root folder.
     
  3. mucker2010

    mucker2010

    Joined:
    May 24, 2011
    Messages:
    505
    I agree with couriant. The problem you have is that \\christine is not a share name. It is the name of the PC. a share name always comes after the PC name ie \\chrstine\sharename. All copy processes (not just robocopy) cant access \\christine directly. if for example all these shares where under another share like \\christine\share\music, \\christine\share\photos etc it would work with just \\christine\share.

    The way around it is doing as Couriant said \\christine\c$. This is a sharename then you can browse further into the C drive and find the location you want.
     
  4. Couriant

    Couriant Trusted Advisor

    Joined:
    Mar 26, 2002
    Messages:
    32,115
    First Name:
    James
    To add, it can also help you get the subdirectories with the /mir /s /e switches.

    Again it should work providing you have admin access/permission. Let us know if it works :)
     
  5. gamradtb

    gamradtb

    Joined:
    Jun 6, 2006
    Messages:
    2
    Hi,

    I have been working on running robocopy as a service. If you wish I can help you install robocopy as a service and explain how to run it with the correct credentials to go through the admin shares or you can create a new share just for this purpose with read only permissions (Recommended).

    Requirements:
    srvany.exe - Path Placement: E:\Program Files\Robocopy\bin (Windows 2003 Resource Kit)
    robocopy.exe - Path placement: E:\Program Files\Robocopy\bin (Windows XP/2003 Resource Kit)
    robocopy.rcj - Path placement: E:\Program Files\Robocopy\jobs (Attached file robocopy.txt - rename to .rcj)
    log folder - Path Create: E:\Program Files\Robocopy\logs (Create for logging Service status)

    Paths can be changed to C:\ or X:\ whichever. It involves some editing.


    This is just roughing it so bare with me. I am currently working on a Inno Setup technique to make it easier.
    I have attached a file named Srvany_Robocopy_svc.txt which is to be renamed to a .reg file.

    Note:
    Lines for editing in Srvany_Robocopy_svc file (Lines 16-AppDirectory, 17-Application and 18-AppParameters). We will also change the path of line 7-10 (ImagePath) after it is imported into the register through regedit in key (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Robocopy). The change is because if the path changes form E: to C: etc. It is in plain text in registry.

    Lines for editing in robocopy.rcj (Lines 12-source,18-destination, 43-/mon #of changes that start a sync, and 58-logging) Other lines can be added for additional options or edited for changing current options.

    Lines to be edited in

    I think that is it.

    Let me know if you have any questions

    Summary:
    1. Create folder structure
    2. C:\Program Files\Robocopy\ under this create bin, jobs, and logs.
    3. Place files srvany.exe and robocopy.exe in C:\Program Files\Robocopy\bin
    4. Place file robocopy.rcj in C:\Program Files\Robocopy\jobs
    5. Run registry file in this posting after it has been edited appropriately
    6. Edit the robocopy.rcj appropriately
    7. Edit the registry for the ImagePath variable to match your environment (C:\Program Files\Robocopy\bin\srvany.exe)
    8. Create a user on both machines with same user id and password
    9. Create a new share or make the new user a admin on the box so it can access the \\server\e$ share
    10. Open the services.msc (Applet) and open the Robocopy Service assign the Log On credentials as the user you created. (This user will have to be a Admin on the box the service is running on. It helps eliminate issues when trying to run the service on the machine.)

    It is detailed but works well

    I hope this helps.


    Thanks,

    Brent
     
  6. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    A simple, schedulable backup program like Replicator will allow you to use wildcards freely and has many other useful options.

    If you install it as a system service with machine credentials, it will run regardless of who is logged on.
     
  7. mucker2010

    mucker2010

    Joined:
    May 24, 2011
    Messages:
    505
    I dont think the OP needs it scheduled though does he? OP, do you? i thought this was for you to run manual backups using your robocopy script?

    If he wanted to automate it the easiest option is to run it as a scheduled task. I am surprised no one mentioned this. that is then bascially an automated backup. when creating the task you can specify the user account it will run as and whether it will run non interactively (no one logged in). This achieves exactly what gamrad said but far simpler.
     
  8. zx10guy

    zx10guy Trusted Advisor Spam Fighter

    Joined:
    Mar 30, 2008
    Messages:
    5,906
    Whatever you do, be very careful about the flags you set with robocopy. If you set something incorrectly to delete the source files without intending on doing so, recovery of those files is next to impossible.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Robocopy Folders network
  1. Duke777
    Replies:
    1
    Views:
    102
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1002608

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice