ERROR 2 (0x00000002) Time-Stamping Destination File path The system cannot find the file specified.

Somya Chawla 1 Reputation point
2021-02-05T14:43:33.1+00:00

While running the robocopy command on Windows 2008 R2 it is giving below error after showing 100% file copied

ERROR 2 (0x00000002) Time-Stamping Destination FilePath
The system cannot find the file specified.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,373 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Jenny Feng 14,166 Reputation points
    2021-02-08T07:27:41.06+00:00

    Hi,
    Here are some posts with the similar issue with yours, just for your reference, you can try the method mentioned in them:
    https://stackoverflow.com/questions/29534173/robocopy-and-source-folder-name-encoding
    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
    Hope above information can help you.

    ============================================
    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. mark lerseth 1 Reputation point
    2022-06-02T02:46:43.677+00:00

    Hi Microsoft users,
    I recently restarted my computer and found my terminal open with this error code [code 2 (0x00000002)].
    I guess this is a Time-Stamping Destination error. I thought time stamping only dealt with photos. I am intermediate in my tech knowledge. Maybe someone can explain the error in layman terms.

    0 comments No comments

  3. joseph higgins 1 Reputation point
    2022-10-21T17:32:22.243+00:00

    The file is locked. Most everyone in powershell uses something like
    Test-FileLock
    You can search for it.
    Some application has exclusive access to the file.
    For a windows 10 users, 3 standard files that are always locked are:
    '\NTUSER.DAT', '\ntuser.dat.LOG1', and '\ntuser.dat.LOG2'

    So, for the OP, my robocopy code in powershell would have something like this
    to prevent me from trying to open up the file for reading:

        $LocalFile1 = '\NTUSER.DAT'           # may be open for writing, exclude this  
        $LocalFile2 = '\ntuser.dat.LOG1'      # may be open for writing, exclude this  
        $LocalFile3 = '\ntuser.dat.LOG2'      # may be open for writing, exclude this  
        $LocalFile4 = '\OneDrive\.12345'     # may be open for writing, exclude this   
    

    @Mark Gago ,
    As far as your terminal open with the error, you would have to look at the filename and
    see if it inappropriately locked. Sometimes, applications lock a file, then the application crashes,
    but somehow, the lock never gets removed. The files, when locked, usually have an extension of .lck

    The test-filelock does not work appropriately when you are using powershell psdrives - but that's a different topic.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.