Windows 10 mirror a folder to a network share

Discussion in 'Computing and Networks' started by AlbertHall, Feb 23, 2019.

  1. AlbertHall

    Thread Starter AAC Fanatic!

    Jun 4, 2014
    7,648
    1,867
    So I have a laptop on the network which has a folder shared and I am trying to mirror a folder on one laptop to the shared folder on the second machine.
    Robocopy seems to be able to do the job, except that I get the message that the network share is write protected and as it isn't I am guessing it is because it needs username/password for access and you can't do that in robocopy.

    So some research led me to 'net use' but the example command lines are as clear as mud - which parts are copied verbatim and which bits are to be replaced with your own values.

    example command line:
    NET USE \\RemoteServerName\IPC$ /u:server\user *password*

    Let's pretend the remote share is \\bckup2\documents, user name is Albert, password is pwalbert
    what should the command line become?
     
  2. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    4,878
    1,838
    net use Z: \\bckup2\documents /u:bckup2\Albert pwalbert

    This creates a drive, Z:, pointing to the documents folder on bckup2. You have to enable file sharing on bckup2 and define “documents” as a share name, with appropriate security “Albert” must have full access to the share.
     
  3. AlbertHall

    Thread Starter AAC Fanatic!

    Jun 4, 2014
    7,648
    1,867
    OK - the net use line seems to work but I still get the 'write protected' error.

    C:\Users\Jim\Documents>robocopy "C:\Users\Jim\Documents" Z: /Z /MIR /r:3 /w:2

    -------------------------------------------------------------------------------
    ROBOCOPY :: Robust File Copy for Windows
    -------------------------------------------------------------------------------

    Started : 23 February 2019 13:47:52
    Source : C:\Users\Jim\Documents\
    Dest : Z:\

    Files : *.*

    Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /Z /R:3 /W:2

    ------------------------------------------------------------------------------

    2 C:\Users\Jim\Documents\
    2019/02/23 13:47:52 ERROR 19 (0x00000013) Accessing Destination Directory Z:\
    The media is write protected.
    Waiting 2 seconds... Retrying...
    2019/02/23 13:47:54 ERROR 19 (0x00000013) Accessing Destination Directory Z:\
    The media is write protected.
    Waiting 2 seconds... Retrying...
    2019/02/23 13:47:56 ERROR 19 (0x00000013) Accessing Destination Directory Z:\
    The media is write protected.
    Waiting 2 seconds... Retrying...
    2019/02/23 13:47:58 ERROR 19 (0x00000013) Accessing Destination Directory Z:\
    The media is write protected.

    ERROR: RETRY LIMIT EXCEEDED.

    C:\Users\Jim\Documents\FreeFileSync>NET USE Z: /D
    Z: was deleted successfully.
     
  4. eetech00

    Senior Member

    Jun 8, 2013
    1,520
    300
    Try this test...

    1. Connect to the share
    (use the "net use" command)

    Verify by executing:
    net use <enter>
    from a command prompt.

    2. Browse to the share with windows explorer and view the content.
    check to see if you can view the content (understanding there may not be any content :) )

    3. If you can view the folder content without error, then try copying a file to the shared folder.
    use the "copy" and "paste" method from windows explorer.

    4. If there is an error when you attempt 3, then go to the "bckup2" computer and check the "share"
    permissions on the folder. Browse to the share and check the "properties". It should show "Full Control Allow" box checked. If not, check the box.

    5. Do 3-4 until you can copy a file successfully.

    6. When step 5 is successful, then try robocopy..

    eT
     
    djsfantasi likes this.
  5. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    4,878
    1,838
    Great description by eetech00.

    Especially, step 4!
     
  6. AlbertHall

    Thread Starter AAC Fanatic!

    Jun 4, 2014
    7,648
    1,867
    I opened a DOS box and put the needed commands in there. Steps 1 thru 6 all work without error (except 'permission denied' for 'My Pictures, My Videos, and My Music' but I don't use those anyway).
    BUT if I put the robocopy line in a batch file and it opens its own DOS box I am back to write protected!
     
  7. AlbertHall

    Thread Starter AAC Fanatic!

    Jun 4, 2014
    7,648
    1,867
    Hah! Sussed!
    Comodo Antivirus clearly doesn't like batch files and decided to "contain" it so it runs in its own little world so of course it has no network access!
    Pah!
    Now to work out how to 're-educate' it...
     
Loading...