Меню

Robocopy ошибка 2 0x00000002

  • Remove From My Forums
  • Question

  • Hi All,

    I have a problem when using robot copy. when robot will try to copy the office 2007/2010 temp file as is start ~$xxx.xlsx . but robot copy will fail to locate the file.

    Can i set the robot copy dont copy the office temp file.

    below is my script.

    robocopy «\XXIT» «D:BackupIT» /e /mir /XX /np /z /mt /log+:IT_backup_log.txt

    • Moved by

      Wednesday, April 2, 2014 2:52 AM
      Moving to more appropriate forum

Answers

  • Add «XF ~*.*»  to your copy command?   (I haven’t tried it myself.)

    >robocopy «\XXIT» «D:BackupIT» /e /mir /XX /np /z /mt /xf ~*.* /log+:IT_backup_log.txt


    Bob Comer

    • Marked as answer by
      kelvin_hsu
      Tuesday, April 15, 2014 1:24 AM

    • Marked as answer by
      kelvin_hsu
      Tuesday, April 15, 2014 1:23 AM
  • Remove From My Forums
  • Question

  • Hi All,

    I have a problem when using robot copy. when robot will try to copy the office 2007/2010 temp file as is start ~$xxx.xlsx . but robot copy will fail to locate the file.

    Can i set the robot copy dont copy the office temp file.

    below is my script.

    robocopy «\XXIT» «D:BackupIT» /e /mir /XX /np /z /mt /log+:IT_backup_log.txt

    • Moved by

      Wednesday, April 2, 2014 2:52 AM
      Moving to more appropriate forum

Answers

  • Add «XF ~*.*»  to your copy command?   (I haven’t tried it myself.)

    >robocopy «\XXIT» «D:BackupIT» /e /mir /XX /np /z /mt /xf ~*.* /log+:IT_backup_log.txt


    Bob Comer

    • Marked as answer by
      kelvin_hsu
      Tuesday, April 15, 2014 1:24 AM

    • Marked as answer by
      kelvin_hsu
      Tuesday, April 15, 2014 1:23 AM
  • Remove From My Forums
  • Question

  • Hi All,

    I have a problem when using robot copy. when robot will try to copy the office 2007/2010 temp file as is start ~$xxx.xlsx . but robot copy will fail to locate the file.

    Can i set the robot copy dont copy the office temp file.

    below is my script.

    robocopy «\XXIT» «D:BackupIT» /e /mir /XX /np /z /mt /log+:IT_backup_log.txt

    • Moved by

      Wednesday, April 2, 2014 2:52 AM
      Moving to more appropriate forum

Answers

  • Add «XF ~*.*»  to your copy command?   (I haven’t tried it myself.)

    >robocopy «\XXIT» «D:BackupIT» /e /mir /XX /np /z /mt /xf ~*.* /log+:IT_backup_log.txt


    Bob Comer

    • Marked as answer by
      kelvin_hsu
      Tuesday, April 15, 2014 1:24 AM

    • Marked as answer by
      kelvin_hsu
      Tuesday, April 15, 2014 1:23 AM

Author David Rees

davidr4


This person is a Verified Professional

This person is a verified professional.

Verify your account
to enable IT peers to see that you are a professional.

habanero

I put [ ] there to show where a space might be in the folder name.   Go back into command prompt and try to copy and paste that whole path from windows explorer into a cd command.  Copy and paste it instead of typing it out.  

cd e:multimediamultimedia archive2013 CW-TW worship media

or CD to the multimedia archive folder and do a dir command to list all the folders

Double check permissions.


Was this post helpful?
thumb_up
thumb_down

Hello Experts,

I have ran into a issue that has me stumped. I have this batch file that I use to backup a laptop to a network drive. The backup has been working correctly for many months with no errors, now earlier this week I have started getting this error msg:

ERROR 2 (0x00000002) Creating Destination Directory F:HP6910pDailyBackupDesktop_New1Scripts
The system cannot find the file specified.
Waiting 30 seconds… Retrying…

2012/10/19 11:21:39 ERROR 2 (0x00000002) Creating Destination Directory F:HP6910pDailyBackupDesktop_New1Scripts
The system cannot find the file specified.
Waiting 30 seconds… Retrying…

What is causing this and how do I fix it?

I have tried changing the destination path but that fails also.

I have other laptops that are running this same script to the same network drive(different folders on the drive) and they are all working fine.

Any help would be great.

Below is the code that is in a file named backup.bat. Text version is attached.

echo %Date% %time%
@echo on
echo ==================================================:  %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

rem cleanup the harddrive
echo Disk Cleanup Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
c:windowssystem32cleanmgr.exe /dc /sagerun: 1

c:
cd
cd c:windowsprefetch
del *.* /q
c:
cd

IF NOT EXIST F:NUL goto NOT_EXIST
ECHO DRIVE F: IS READY >> C:UserspardoneDesktopScriptsBackUpLog.txt
@ping 127.0.0.1 -n 2 -w 12000 > nul
echo Disk Cleanup Completed: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

cd C:UserspardoneDesktopScripts

echo BackUp Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo Log Files Are Located At F:HP6910pDailyBackupLogs >> C:UserspardoneDesktopScriptsBackUpLog.txt

rem shutdown outlook, communicator and firefox
taskkill /im outlook.exe /F
echo Mircosoft Outlook Shutdown: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

taskkill /im communicator.exe /F
echo Mircosoft Communicator Shutdown: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

taskkill /im firefox.exe /F
echo Firefox Shutdown: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

@ping 127.0.0.1 -n 2 -w 12000 > nul

echo PST Copy Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
robocopy «C:PST» «F:HP6910pDailyBackupPST» /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogPST.txt
robocopy «C:UserspardoneDesktopScripts» «F:HP6910pDailyBackupLogs» BackUpLogPST.txt
rename F:HP6910pDailyBackupLogsBackUpLogPST.txt BackUpLogPST_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del «C:UserspardoneDesktopScriptsBackUpLogPST.txt»
echo PST Copy Completed: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo Details are in BackUpLogPST_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:HP6910pDailyBackupLogs >> C:UserspardoneDesktopScriptsBackUpLog.txt

echo Outlook Copy Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
robocopy «C:UserspardoneAppDataLocalMicrosoftOutlook» «F:HP6910pDailyBackupOutlook» /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogOutlook.txt
robocopy «C:UserspardoneDesktopScripts» «F:HP6910pDailyBackupLogs» BackUpLogOutlook.txt
rename F:HP6910pDailyBackupLogsBackUpLogOutlook.txt BackUpLogOutlook_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del «C:UserspardoneDesktopScriptsBackUpLogOutlook.txt»
echo Outlook Copy Completed: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo Details are in BackUpLogOutlook_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:HP6910pDailyBackupLogs >> C:UserspardoneDesktopScriptsBackUpLog.txt

start «» «C:Program Files (x86)Microsoft OfficeOFFICE14outlook.exe»
echo Mircosoft Outlook Application Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

start «» «C:Program Files (x86)Microsoft Lynccommunicator.exe»
echo Mircosoft Communicator Application Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

echo Desktop Copy Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
robocopy «C:UserspardoneDesktop» «F:HP6910pDailyBackupDesktop_New1» /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogDesktop.txt
robocopy «C:UserspardoneDesktopScripts» «F:HP6910pDailyBackupLogs» BackUpLogDesktop.txt
rename F:HP6910pDailyBackupLogsBackUpLogDesktop.txt BackUpLogDesktop_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del «C:UserspardoneDesktopScriptsBackUpLogDesktop.txt»
echo Desktop Copy Completed: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo Details are in BackUpLogDesktop_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:HP6910pDailyBackupLogs >> C:UserspardoneDesktopScriptsBackUpLog.txt

echo My Documents Copy Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
robocopy «C:UserspardoneMy Documents» «F:HP6910pDailyBackupMy Documents» /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogDocuments.txt
robocopy «C:UserspardoneDesktopScripts» «F:HP6910pDailyBackupLogs» BackUpLogDocuments.txt
rename F:HP6910pDailyBackupLogsBackUpLogDocuments.txt BackUpLogDocuments_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del «C:UserspardoneDesktopScriptsBackUpLogDocuments.txt»
echo My Documents Copy Completed: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo Details are in BackUpLogDocuments_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:HP6910pDailyBackupLogs >> C:UserspardoneDesktopScriptsBackUpLog.txt

echo Favorites Copy Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
robocopy «C:UserspardoneFavorites» «F:HP6910pDailyBackupFavorites» /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogFavorites.txt
robocopy «C:UserspardoneDesktopScripts» «F:HP6910pDailyBackupLogs» BackUpLogFavorites.txt
rename F:HP6910pDailyBackupLogsBackUpLogFavorites.txt BackUpLogFavorites_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del «C:UserspardoneDesktopScriptsBackUpLogFavorites.txt»
echo Favorites Copy Completed: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo Details are in BackUpLogFavorites_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:HP6910pDailyBackupLogs >> C:UserspardoneDesktopScriptsBackUpLog.txt

echo Firefox Copy Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
robocopy «C:UserspardoneAppDataRoamingMozillaFirefox» «F:HP6910pDailyBackupFirefox» /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogFirefox.txt
robocopy «C:UserspardoneDesktopScripts» «F:HP6910pDailyBackupLogs» BackUpLogFirefox.txt
rename F:HP6910pDailyBackupLogsBackUpLogFirefox.txt BackUpLogFirefox_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del «C:UserspardoneDesktopScriptsBackUpLogFirefox.txt»
echo Firefox Copy Completed: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo Details are in BackUpLogFirefox_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:HP6910pDailyBackupLogs >> C:UserspardoneDesktopScriptsBackUpLog.txt

rem start «» «C:Program Files (x86)Mozilla Firefoxfirefox.exe»
rem echo Firefox Application Started: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

echo BackUp Finished: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
echo ==================================================:  %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt

:NOT_EXIST
rem echo BackUp Did Not Run: %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
rem Echo DRIVE F: IS NOT READY >> C:UserspardoneDesktopScriptsBackUpLog.txt
rem echo ==================================================:  %Date% %time% >> C:UserspardoneDesktopScriptsBackUpLog.txt
rem GOTO END

:END

Backup.txt

Hello I am trying to move the users directory from my C drive to my D drive to free up some space. I found this thread from a quick google search. I wasn’t sure how to «boot to installation media». I inserted what I believe is the windows installation disc, but nothing happens when I restart, which I believe is due to boot order settings in BIOS.

In any event, I just hit F8 after restarting the computer, went into repair mode and clicked on command prompt. The command prompt had this:

Microsoft Windows [Version 6.1.7601]

X:windowssystem32>

After the «system32>» I typed the following (taken from the top comment of the above link):

robocopy c:Users d:Users /mir /xj /copyall

I then got:

ROBOCOPY :: Robust File Copy for Windows

Started: Thu Jun 26 15:58:35 2014

Source : c:Users
Dest : d:Users

Files: *.*

Options: *.* /S /E /COPYALL /PURGE /MIR /XJ /R:1000000 /W:30

2014/06/24 15:58:35 ERROR 2 <0X00000002> Accessing Source Directory c:Users

The system cannot find the file specified.

Any ideas what’s going on? It’s running windows 7. There are just a couple files in the d drive currently, nothing else. I had previously copied some files from users in the c drive and pasted them to the d drive, and then deleted them from the c drive, but I don’t think that’s an issue.

I really need to free up some space on the c drive, so if someone could help with this or suggest another way to clear up space on the c drive, that would be a big help — thanks!

  • Home
  • Forum
  • Technical Support
  • Computer Help
  • Windows Server
  • Windows Server Help
  • Robocopy ERROR 2 (0x00000002)

  1. Robocopy ERROR 2 (0x00000002)

    Hi

    I am getting following error while copying data using Robocopy.

    «ERROR 2 (0x00000002) Time-Stamping Destination File Y:file10112
    The system cannot find the file specified.»

    Above error does not have any effect on the copy operation and data gets copied correctly. MD5SUM of source and destination also matches.

    I have 25000 such files. Source as well as Destination Y: is a CIFS share.

    Please help to find cause behind this error.

    Thanks
    Anup


  2. Re: Robocopy ERROR 2 (0x00000002)

    Hello,

    Any chance you have an anti-virus running on the destination server?
    If so, can you try after (temporarily) disabling it?


    Marc [MCSE, MCTS, MVP]
    [Heureux celui qui a pu pénétrer les causes secrètes des choses]
    [Blog: http://www.marc-antho-etc.net/blog/]

    «getannupalways» <getannupalways.3mzcnb@DoNotSpam.com> wrote in message
    news:getannupalways.3mzcnb@DoNotSpam.com…


    >
    > Hi
    >
    > I am getting following error while copying data using Robocopy.
    >
    > «ERROR 2 (0x00000002) Time-Stamping Destination File Y:file10112
    > The system cannot find the file specified.»
    >
    > Above error does not have any effect on the copy operation and data
    > gets copied correctly. MD5SUM of source and destination also matches.
    >
    > I have 25000 such files. Source as well as Destination Y: is a CIFS
    > share.
    >
    > Please help to find cause behind this error.
    >
    >
    > Thanks
    > Anup
    >
    >
    > —
    > getannupalways
    > ————————————————————————
    > getannupalways’s Profile:
    > http://forums.techarena.in/members/getannupalways.htm
    > View this thread:
    > http://forums.techarena.in/windows-s…lp/1114023.htm
    >
    > http://forums.techarena.in
    >


  3. Re: Robocopy ERROR 2 (0x00000002)

    Hi Marc,

    Thanks for the Reply. I don’t have anti-virus installed on the machine

    Thanks
    Anup


  4. RE: Robocopy ERROR 2 (0x00000002)

    I have exactly the same problem.
    Can i ignor the error 2 code or what?

    «getannupalways» wrote:


    >
    > Hi
    >
    > I am getting following error while copying data using Robocopy.
    >
    > «ERROR 2 (0x00000002) Time-Stamping Destination File Y:file10112
    > The system cannot find the file specified.»
    >
    > Above error does not have any effect on the copy operation and data
    > gets copied correctly. MD5SUM of source and destination also matches.
    >
    > I have 25000 such files. Source as well as Destination Y: is a CIFS
    > share.
    >
    > Please help to find cause behind this error.
    >
    >
    > Thanks
    > Anup
    >
    >
    > —
    > getannupalways
    > ————————————————————————
    > getannupalways’s Profile: http://forums.techarena.in/members/getannupalways.htm
    > View this thread: http://forums.techarena.in/windows-s…lp/1114023.htm
    >
    > http://forums.techarena.in
    >
    >


  5. RE: Robocopy ERROR 2 (0x00000002)

    I have exactly the same problem!
    Can I ignore the Error 2 code or what?

    «getannupalways» wrote:


    >
    > Hi
    >
    > I am getting following error while copying data using Robocopy.
    >
    > «ERROR 2 (0x00000002) Time-Stamping Destination File Y:file10112
    > The system cannot find the file specified.»
    >
    > Above error does not have any effect on the copy operation and data
    > gets copied correctly. MD5SUM of source and destination also matches.
    >
    > I have 25000 such files. Source as well as Destination Y: is a CIFS
    > share.
    >
    > Please help to find cause behind this error.
    >
    >
    > Thanks
    > Anup
    >
    >
    > —
    > getannupalways
    > ————————————————————————
    > getannupalways’s Profile: http://forums.techarena.in/members/getannupalways.htm
    > View this thread: http://forums.techarena.in/windows-s…lp/1114023.htm
    >
    > http://forums.techarena.in
    >
    >


Similar Threads

  1. Replies: 3

    Last Post: 03-01-2014, 12:09 PM

  2. Replies: 4

    Last Post: 02-01-2014, 10:32 AM

  3. Replies: 3

    Last Post: 31-12-2013, 10:41 AM

  4. Replies: 7

    Last Post: 01-02-2011, 04:10 PM

  5. Replies: 5

    Last Post: 15-05-2007, 08:31 AM

Tags for this Thread

Bookmarks

Bookmarks


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are Off
  • [IMG] code is Off
  • [VIDEO] code is Off
  • HTML code is Off

Forum Rules

I am struggling with how to handle a deploy script that sometimes returns a 2 during robocopy. The command and output are below.

It returns 2, which means «extra file».

It appears, overall, to be a success. Should I just accept 2 as being success?

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

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

  Started : Tuesday, January 24, 2017 11:53:40 PM
   Source : C:DownloadTemp\
     Dest : C:Inetpub\

    Files : *.*

  Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /MT:8 /R:1000000 /W:30 

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

      *EXTRA File         689351    C:Inetpub\admindynamicfile2.zip

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

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :       510       510         0         0         0         0
   Files :      3564         0      3564         0         0         1
   Bytes :  606.15 m         0  606.13 m         0         0   673.1 k
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : Tuesday, January 24, 2017 11:53:40 PM

Ansgar Wiechers's user avatar

asked Jan 25, 2017 at 6:17

Jonesome Reinstate Monica's user avatar

2

When in doubt, read the documentation (although in this case SS64 might be a better source):

The following table lists and describes the return codes that are used by the Robocopy utility.

0 No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.
1 All files were copied successfully.
2 There are some additional files in the destination directory that are not present in the source directory. No files were copied.
3 Some files were copied. Additional files were present. No failure was encountered.
5 Some files were copied. Some files were mismatched. No failure was encountered.
6 Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory.
7 Files were copied, a file mismatch was present, and additional files were present.
8 Several files did not copy.

Note Any value greater than 8 indicates that there was at least one failure during the copy operation.

Exit codes up to and including 7 indicate non-error operational status. Exit codes of 8 and above indicate errors.

Like Mathias already said, whether you do or don’t want to treat extra files as an error is up to you. If you don’t care about extra or mismatched files/folders just check for exit codes greater than 7:

& robocopy ...
if ($LastExitCode -gt 7) {
    # an error occurred
    exit $LastExitCode
}
exit 0

otherwise check for exit codes greater than 1:

& robocopy ...
if ($LastExitCode -gt 1) {
    # an error occurred
    exit $LastExitCode
}
exit 0

answered Jan 25, 2017 at 10:22

Ansgar Wiechers's user avatar

Ansgar WiechersAnsgar Wiechers

189k23 gold badges240 silver badges313 bronze badges

1

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Robocopy ошибка 123 0x0000007b
  • Robocopy ошибка 0 0x00000000