Announcement

Collapse
No announcement yet.

Robocopy /move problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Robocopy /move problem

    Hi

    In Windows 8.x, should I move the entire contents of a directory (containing files and directories) in a Media sub-directory.

    I have:

    Code:
    c:\Test
    c:\Test\<File_name1>.txt
    c:\Test\<File_name2>.txt
    c:\Test\b
    c:\Test\c
    I have tried with the command

    Code:
    robocopy c:\Test c:\Test\Media /move
    but it only moves the files of the Test directory.

    How come the move option of robocopy acts like the mov option that is to say moves only the files and not the directories?

    So, how do I move even the directory?

    Thanks

    Bye
    balubeto

  • #2
    Re: Robocopy /move problem

    You need to tell it to act on sub dirs:
    Code:
    robocopy c:\Test c:\Test\Media /E /move
    Regards,
    Jeremy

    Network Consultant/Engineer
    Baltimore - Washington area and beyond
    www.gma-cpa.com

    Comment


    • #3
      Re: Robocopy /move problem

      Originally posted by JeremyW View Post
      You need to tell it to act on sub dirs:
      Code:
      robocopy c:\Test c:\Test\Media /E /move
      I tried but the entire contents of the c:\Test directory is moved to c:\Test\Media\Media and not to c:\Test\Media directory. Why?

      Thanks

      Bye
      balubeto

      Comment


      • #4
        Re: Robocopy /move problem

        Was the media subdirectory already in C:\Test? If so, it looks like some sort of infinite loop

        Can you please research robocopy on and look at alterative syntax options
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment


        • #5
          Re: Robocopy /move problem

          Originally posted by Ossian View Post
          Was the media subdirectory already in C:\Test?
          No.

          Thanks

          Bye
          balubeto

          Comment


          • #6
            Re: Robocopy /move problem

            It appears to be an artefact of copying to a directory (whether it exists or not) within the directory you are moving from

            From the robocopy output, it copies files at the root, then directoriess within the root, so it will (in order):
            Create Media Directory if it doesn't exist
            Copy Files to the Media directory
            Copy the media directory (now with content) to the media directory

            If you do the same to a different directory (robocopy c:\Test c:\Test2\Media /E /MOVE) this does not happen

            If you look at your robocopy output (you did?) you will see the same
            Tom Jones
            MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
            PhD, MSc, FIAP, MIITT
            IT Trainer / Consultant
            Ossian Ltd
            Scotland

            ** Remember to give credit where credit is due and leave reputation points where appropriate **

            Comment

            Working...
            X