none
want Robocopy switch to delete the file after copying RRS feed

  • Question

  •   Hi Everybody,

                          I am quite a new to robocopy and scripting.

                          I have a robocopy script that copies data around 100gb from network location. After the copying data is over I have to manually delete the backup file.

                          Is it possible for the robocopy to automatically delete the data after the successful copy.

                          Waiting for your kind reply.

     

    Thanks,

    Amit

    Monday, July 23, 2012 10:36 AM

Answers

  • Use the /MOV parameter.  From the help:

     /MOV :: MOVe files (delete from source after copying).
     /MOVE :: MOVE files AND dirs (delete from source after copying).


    Grant Ward, a.k.a. Bigteddy

    Monday, July 23, 2012 10:44 AM
  • To add to Grant's reply:

    This isn't really a scripting question. In addition, here's how you can find the answer yourself: Go to a search engine and use the phrase "robocopy switches".

    Also, command-line tools such as robocopy often have built-in help when you type "/?" as the first parameter after the command's name on the command line:


    robocopy /?

    Bill

    Monday, July 23, 2012 2:59 PM
    Moderator

All replies

  • Use the /MOV parameter.  From the help:

     /MOV :: MOVe files (delete from source after copying).
     /MOVE :: MOVE files AND dirs (delete from source after copying).


    Grant Ward, a.k.a. Bigteddy

    Monday, July 23, 2012 10:44 AM
  • To add to Grant's reply:

    This isn't really a scripting question. In addition, here's how you can find the answer yourself: Go to a search engine and use the phrase "robocopy switches".

    Also, command-line tools such as robocopy often have built-in help when you type "/?" as the first parameter after the command's name on the command line:


    robocopy /?

    Bill

    Monday, July 23, 2012 2:59 PM
    Moderator
  • Perhaps the user has already tried /MOV and /MOVE.  I have tried using /MOVE with robocopy before with no luck transferring subdirectories.
    • Edited by RootMason Tuesday, March 29, 2016 9:08 PM
    Tuesday, March 29, 2016 9:08 PM
  • Me either.  Grant and Bill think Amit will learn about error levels from /?
    Wednesday, December 6, 2017 10:08 PM