Guest alex.taylor@comcare.gov.au Posted September 6, 2007 Posted September 6, 2007 >From dos prompt: robocopy /r:1 /w:1 \\xyz\xx yy if errorlevel 16 echo ***FATAL ERROR*** & goto end if errorlevel 15 echo FAIL MISM XTRA COPY & goto end if errorlevel 14 echo FAIL MISM XTRA & goto end if errorlevel 13 echo FAIL MISM COPY & goto end if errorlevel 12 echo FAIL MISM & goto end if errorlevel 11 echo FAIL XTRA COPY & goto end if errorlevel 10 echo FAIL XTRA & goto end if errorlevel 9 echo FAIL COPY & goto end if errorlevel 8 echo FAIL & goto end if errorlevel 7 echo MISM XTRA COPY & goto end if errorlevel 6 echo MISM XTRA & goto end if errorlevel 5 echo MISM COPY & goto end if errorlevel 4 echo MISM & goto end if errorlevel 3 echo XTRA COPY & goto end if errorlevel 2 echo XTRA & goto end if errorlevel 1 echo COPY & goto end if errorlevel 0 echo --no change-- & goto end :end gives: --------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows :: Version XP02 --------------------------------------------------------------------------- Started : Thu Sep 06 15:42:40 2007 2007/09/06 15:42:48 ERROR 53 (0x00000035) Getting File System Type of Sourc The network path was not found. Source - \\xyz\xx\ Dest : C:\work\robocopy\yy\ Files : *.* Options : *.* /COPY:DAT /R:1 /W:1 --------------------------------------------------------------------------- 2007/09/06 15:42:48 ERROR 53 (0x00000035) Accessing Source Directory \ \xyz\ The network path was not found. Waiting 1 seconds... Retrying... 2007/09/06 15:42:49 ERROR 53 (0x00000035) Accessing Source Directory \ \xyz\ The network path was not found. ERROR: RETRY LIMIT EXCEEDED. 2007/09/06 15:42:49 ERROR 53 (0x00000035) Accessing Source Directory \ \xyz\ The network path was not found. C:\work\robocopy>if errorlevel 16 echo ***FATAL ERROR*** & goto end C:\work\robocopy>if errorlevel 15 echo FAIL MISM XTRA COPY & goto end C:\work\robocopy>if errorlevel 14 echo FAIL MISM XTRA & goto end C:\work\robocopy>if errorlevel 13 echo FAIL MISM COPY & goto end C:\work\robocopy>if errorlevel 12 echo FAIL MISM & goto end C:\work\robocopy>if errorlevel 11 echo FAIL XTRA COPY & goto end C:\work\robocopy>if errorlevel 10 echo FAIL XTRA & goto end C:\work\robocopy>if errorlevel 9 echo FAIL COPY & goto end C:\work\robocopy>if errorlevel 8 echo FAIL & goto end C:\work\robocopy>if errorlevel 7 echo MISM XTRA COPY & goto end C:\work\robocopy>if errorlevel 6 echo MISM XTRA & goto end C:\work\robocopy>if errorlevel 5 echo MISM COPY & goto end C:\work\robocopy>if errorlevel 4 echo MISM & goto end C:\work\robocopy>if errorlevel 3 echo XTRA COPY & goto end C:\work\robocopy>if errorlevel 2 echo XTRA & goto end C:\work\robocopy>if errorlevel 1 echo COPY & goto end C:\work\robocopy>if errorlevel 0 echo --no change-- & goto end --no change-- There errorlevel is not set! Does anyone know a work around for this?
Guest Pegasus \(MVP\) Posted September 6, 2007 Posted September 6, 2007 Re: robocopy Version XP026 errorlevel not set <alex.taylor@comcare.gov.au> wrote in message news:1189058844.609351.134050@g4g2000hsf.googlegroups.com... > >From dos prompt: > robocopy /r:1 /w:1 \\xyz\xx yy > if errorlevel 16 echo ***FATAL ERROR*** & goto end > if errorlevel 15 echo FAIL MISM XTRA COPY & goto end > if errorlevel 14 echo FAIL MISM XTRA & goto end > if errorlevel 13 echo FAIL MISM COPY & goto end > if errorlevel 12 echo FAIL MISM & goto end > if errorlevel 11 echo FAIL XTRA COPY & goto end > if errorlevel 10 echo FAIL XTRA & goto end > if errorlevel 9 echo FAIL COPY & goto end > if errorlevel 8 echo FAIL & goto end > if errorlevel 7 echo MISM XTRA COPY & goto end > if errorlevel 6 echo MISM XTRA & goto end > if errorlevel 5 echo MISM COPY & goto end > if errorlevel 4 echo MISM & goto end > if errorlevel 3 echo XTRA COPY & goto end > if errorlevel 2 echo XTRA & goto end > if errorlevel 1 echo COPY & goto end > if errorlevel 0 echo --no change-- & goto end > :end > > gives: > --------------------------------------------------------------------------- > ROBOCOPY :: Robust File Copy for Windows :: Version > XP02 > --------------------------------------------------------------------------- > > Started : Thu Sep 06 15:42:40 2007 > > 2007/09/06 15:42:48 ERROR 53 (0x00000035) Getting File System Type of > Sourc > The network path was not found. > > Source - \\xyz\xx\ > Dest : C:\work\robocopy\yy\ > > Files : *.* > > Options : *.* /COPY:DAT /R:1 /W:1 > > --------------------------------------------------------------------------- > > 2007/09/06 15:42:48 ERROR 53 (0x00000035) Accessing Source Directory \ > \xyz\ > The network path was not found. > Waiting 1 seconds... Retrying... > 2007/09/06 15:42:49 ERROR 53 (0x00000035) Accessing Source Directory \ > \xyz\ > The network path was not found. > > ERROR: RETRY LIMIT EXCEEDED. > > 2007/09/06 15:42:49 ERROR 53 (0x00000035) Accessing Source Directory \ > \xyz\ > The network path was not found. > > C:\work\robocopy>if errorlevel 16 echo ***FATAL ERROR*** & goto > end > > C:\work\robocopy>if errorlevel 15 echo FAIL MISM XTRA COPY & goto > end > > C:\work\robocopy>if errorlevel 14 echo FAIL MISM XTRA & goto > end > > C:\work\robocopy>if errorlevel 13 echo FAIL MISM COPY & goto > end > > C:\work\robocopy>if errorlevel 12 echo FAIL MISM & goto > end > > C:\work\robocopy>if errorlevel 11 echo FAIL XTRA COPY & goto > end > > C:\work\robocopy>if errorlevel 10 echo FAIL XTRA & goto > end > > C:\work\robocopy>if errorlevel 9 echo FAIL COPY & goto end > > C:\work\robocopy>if errorlevel 8 echo FAIL & goto end > > C:\work\robocopy>if errorlevel 7 echo MISM XTRA COPY & goto end > > C:\work\robocopy>if errorlevel 6 echo MISM XTRA & goto end > > C:\work\robocopy>if errorlevel 5 echo MISM COPY & goto end > > C:\work\robocopy>if errorlevel 4 echo MISM & goto end > > C:\work\robocopy>if errorlevel 3 echo XTRA COPY & goto end > > C:\work\robocopy>if errorlevel 2 echo XTRA & goto end > > C:\work\robocopy>if errorlevel 1 echo COPY & goto end > > C:\work\robocopy>if errorlevel 0 echo --no change-- & goto end > --no change-- > > > There errorlevel is not set! > > Does anyone know a work around for this? > I used robocopy Version XP010 and had no problem at all when running the batch file below. In both cases the expected ErrorLevel popped up. @echo off if exist c:\Test rd /s /q c:\Test md c:\Test\Testfile.txt echo %date% %time% > c:\Testfile.txt robocopy c:\ c:\Test Testfile.txt echo Errorlevel is %ErrorLevel% pause robocopy /r:0 "%UserProfile%" c:\Test ntuser.dat echo Errorlevel is %ErrorLevel%
Recommended Posts