Windows 10: robocopy /MIR deleted all my files in the destination folder..

Discus and support robocopy /MIR deleted all my files in the destination folder.. in Windows 10 Network and Sharing to solve the problem; ok so robocopy /MIR deleted all my files in the destination folder.. IT SHOULD HAVE AT LEAST A CONFIRMATION PROMPT BY DEFAULT !!!... Discussion in 'Windows 10 Network and Sharing' started by jaxx_rr, Sep 2, 2019.

  1. jaxx_rr Win User

    robocopy /MIR deleted all my files in the destination folder..


    ok so robocopy /MIR deleted all my files in the destination folder..
    IT SHOULD HAVE AT LEAST A CONFIRMATION PROMPT BY DEFAULT !!!

    :)
     
    jaxx_rr, Sep 2, 2019
    #1
  2. Roohi_Taj Win User

    Robocopy with /MIR fails with Recycle Bin error message

    Thank you for your response, Jim.

    Seems like you've done some great troubleshooting! Your approach towards sorting this issue out is much appreciated.



    We reproduced this issue on our systems with both Robocopy and Xcopy commands based on what you are trying to achieve. Using
    Robocopy with /Mir switch, all the files in the destination folder will be mirrored as in the source and the existing files in the destination will be deleted. The "mirror" switch keeps trees in sync by optionally deleting
    files out of the destination that are no longer present in the source. However, the same command without /Mir does not delete the destination files.

    With the Xcopy, you should be able to achieve the results that you are looking for and the files should be copied without any issues. Hence, I would recommend you to try the Xcopy command and let us know about the results. For more information on Xcopy refer
    the Microsoft article on
    xcopy
    .



    We await your response.



    Roohi Taj S

    Microsoft Community - Moderator
     
    Roohi_Taj, Sep 2, 2019
    #2
  3. Try3 Win User
    robocopy backup of important files


    Robocop,

    You are comparing chalk & cheese. The /mir switch has nothing to do with file attributes. The /m switch does. /mir Mirrors a directory tree
    /m Copies only files for which the Archive attribute is set, and resets the Archive attribute.
    Switches such as the /m switch operate on the source to select which files RoboCopy chooses to work with on that occasion.

    The /mir switch operates on the destination instead. It tells RoboCopy to update files on the destination from the source [where the source has newer ones] and to delete files on the destination that no longer exist in the source.

    So if you RoboCopy source files abcd then you will have abcd on the destination as well
    but if you later delete d from the source you will still have d on the destination.
    Results after next RoboCopy -
    d will stay on the destination if you RoboCopy with the /m switch
    d will be deleted from the destination if you RoboCopy with the /mir switch

    The /mir switch can be very useful.
    1 I use RoboCopy /mir as part of my backup regime. It creates a complete mirror image of all my files on the external HDD that I connect for that backup. If my computers ever failed or the place went up in flames then I could restore all my own folders & files just as they had been at the time the last RoboCopy was made.
    2 I also use RoboCopy /mir as part of my network syncing routine.

    Denis
     
    Try3, Sep 2, 2019
    #3
  4. Russm4226 Win User

    robocopy /MIR deleted all my files in the destination folder..

    When using RoboCopy in Windows 10, I sometimes get errors when I specify a LogFile and RoboCopy Aborts

    I use the following script for all of my RoboCopy functions, the only changes being made are to the SourceDrive, DestinationDrive and Folder variables.

    REM - Backup ProgramData to Drive N:

    REM ********* Set Source and Destination Drives **********

    SET SourceDrive=C:

    SET DestinationDrive=N:

    REM ******************************************************

    REM ***** Generate Source and Destination Folders ********

    SET Folder=ProgramData

    SET Source=%SourceDrive%\%Folder%

    SET Destination=%DestinationDrive%\%Folder%

    SET LogFile=/LOG:%Destination%\Xfer_%Folder%.log

    REM ******************************************************
    REM - Pause - Ready to backup %SourceDrive%\%Folder% Files to the N: Drive?

    robocopy "%Source%" "%Destination%" "%LogFile%" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    REM - robocopy "%Source%" "%Destination%" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    REM - notepad.exe %Destination%\Xfer_%Folder%.log

    Pause - Completed Backup

    It gets to the RoboCopy command: -

    C:\WINDOWS\system32>robocopy "C:\ProgramData" "N:\ProgramData" "/LOG:N:\ProgramData\Xfer_ProgramData.log" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    I then either reports the LogFile can't be found, or in this specific case displays: -

    Log File : N:\ProgramData\Xfer_ProgramData.log

    and freezes. CTRL+C has no effect.

    I have to close the CMD window

    When I REM out the first RoboCopy and enable the second one

    robocopy "%Source%" "%Destination%" /MT:16 /MIR /SEC /XA:SH /XX /R:0 /W:0 /V

    RoboCopy will copy the files

    Any suggestions - 90% of my scripts work perfectly creating the xxx.log file!
     
    Russm4226, Sep 2, 2019
    #4
Thema:

robocopy /MIR deleted all my files in the destination folder..

Loading...
  1. robocopy /MIR deleted all my files in the destination folder.. - Similar Threads - robocopy MIR deleted

  2. Latest updates deleting all my files

    in Windows 10 Installation and Upgrade
    Latest updates deleting all my files: On 8/282019 my computer did an update and all my files were lost. All my videos, pictures etc. All my programs are still installed but lost all my files. I called Microsoft Support because I pay a monthly fee for support and the said my files were gone and basically my comp...
  3. Robocopy with /MIR fails with Recycle Bin error message

    in Windows 10 Network and Sharing
    Robocopy with /MIR fails with Recycle Bin error message: I'm having issues completing my environment setup on my Dell XPS 8930 desktop computer. As mentioned in the subject line, my PC has both an SSD and HDD. The operating system (Windows 10 Pro) is on the SSD as Drive C. The HDD is 2tb and I plan to use this for my user data....
  4. destination folder access denied

    in Windows 10 Drivers and Hardware
    destination folder access denied: hello, I have been trying to move a file from one hard drive to another but every time I tried to do so it came up with "destination folder access denied. you need permission to perform this action." my account is admin and I have tried looking up how to stop this on my own...
  5. destination folder access denied

    in Windows 10 Network and Sharing
    destination folder access denied: Hi team, yesterday I posted a query regarding disc partitioning and got satisfied by a helper named "DAVE". and I was able to shrink my c drive space to D, E, F. But today when I'm trying to paste or delete anything in any of the new volumes whether it be "D", "E" or "F" it...
  6. Destination Folder Access Denied

    in Windows 10 Network and Sharing
    Destination Folder Access Denied: Hello, Looking for some advice on this.. I'm trying to transfer some files into a folder that is in my C:\Program Files (x86) directory but I'm just getting an access denied error.. I've given myself permission through the properties tab and I've tried to give myself...
  7. Robocopy Destination Naming Confusion

    in Windows 10 Support
    Robocopy Destination Naming Confusion: My command is: Code: ROBOCOPY C:\Users\mikei\Documents J:\HP.Files /MIR /XD "C:\Users\mikei\Documents\FeedbackHub" "C:\Users\mikei\Documents\Cyberlink" /v /tee /ts /log:"I:\log.HP.temp.txt" [/quote] Have I made an error again? Earlier I tried to run a similar command as...
  8. Onedrive deleted all my files

    in Windows 10 Software and Apps
    Onedrive deleted all my files: Why onedrive deleted all my files? I had 20 mp3 on my hard disk after i restarted my pc onedrive deleted all of them and put in trash bin. Any help? 13073
  9. Folders and files that will not delete

    in Windows 10 Support
    Folders and files that will not delete: I recently deleted some mp3 files and folders, then when I emptied the Recycle Bin I inadvertently answered "no" to the "are you sure you want to delete these files" question. Now they are sitting on my recent files / frequent folders page and will not delete again. When you...
  10. All my folders and files are suddenly deleted

    in Windows 10 Support
    All my folders and files are suddenly deleted: Those files that got deleted were so important especially for my sister , please guys, help me , im literally crying for hours searching for the solution. I shutted down my laptop early this morning after installing programs (Utility Programs) which i know does not affect or...