troubleshooting Question

ERROR 2 (0x00000002) Robocopy

Avatar of eddiepardon
eddiepardon asked on
Windows BatchMicrosoft Legacy OSWindows 7
10 Comments1 Solution15299 ViewsLast Modified:
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:\HP6910pDailyBackup\Desktop_New1\Scripts\
The system cannot find the file specified.
Waiting 30 seconds... Retrying...

2012/10/19 11:21:39 ERROR 2 (0x00000002) Creating Destination Directory F:\HP6910pDailyBackup\Desktop_New1\Scripts\
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:\Users\pardone\Desktop\Scripts\BackUpLog.txt

rem cleanup the harddrive
echo Disk Cleanup Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

c:
cd \
cd c:\windows\prefetch
del *.* /q
c:
cd \

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

cd C:\Users\pardone\Desktop\Scripts

echo BackUp Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo Log Files Are Located At F:\HP6910pDailyBackup\Logs >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

rem shutdown outlook, communicator and firefox
taskkill /im outlook.exe /F
echo Mircosoft Outlook Shutdown: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

taskkill /im communicator.exe /F
echo Mircosoft Communicator Shutdown: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

taskkill /im firefox.exe /F
echo Firefox Shutdown: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

@ping 127.0.0.1 -n 2 -w 12000 > nul


echo PST Copy Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
robocopy "C:\PST" "F:\HP6910pDailyBackup\PST" /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogPST.txt
robocopy "C:\Users\pardone\Desktop\Scripts" "F:\HP6910pDailyBackup\Logs" BackUpLogPST.txt
rename F:\HP6910pDailyBackup\Logs\BackUpLogPST.txt BackUpLogPST_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del "C:\Users\pardone\Desktop\Scripts\BackUpLogPST.txt"
echo PST Copy Completed: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo Details are in BackUpLogPST_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:\HP6910pDailyBackup\Logs >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

echo Outlook Copy Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
robocopy "C:\Users\pardone\AppData\Local\Microsoft\Outlook" "F:\HP6910pDailyBackup\Outlook" /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogOutlook.txt
robocopy "C:\Users\pardone\Desktop\Scripts" "F:\HP6910pDailyBackup\Logs" BackUpLogOutlook.txt
rename F:\HP6910pDailyBackup\Logs\BackUpLogOutlook.txt BackUpLogOutlook_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del "C:\Users\pardone\Desktop\Scripts\BackUpLogOutlook.txt"
echo Outlook Copy Completed: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo Details are in BackUpLogOutlook_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:\HP6910pDailyBackup\Logs >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

start "" "C:\Program Files (x86)\Microsoft Office\OFFICE14\outlook.exe"
echo Mircosoft Outlook Application Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

start "" "C:\Program Files (x86)\Microsoft Lync\communicator.exe"
echo Mircosoft Communicator Application Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

echo Desktop Copy Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
robocopy "C:\Users\pardone\Desktop" "F:\HP6910pDailyBackup\Desktop_New1" /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogDesktop.txt
robocopy "C:\Users\pardone\Desktop\Scripts" "F:\HP6910pDailyBackup\Logs" BackUpLogDesktop.txt
rename F:\HP6910pDailyBackup\Logs\BackUpLogDesktop.txt BackUpLogDesktop_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del "C:\Users\pardone\Desktop\Scripts\BackUpLogDesktop.txt"
echo Desktop Copy Completed: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo Details are in BackUpLogDesktop_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:\HP6910pDailyBackup\Logs >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt


echo My Documents Copy Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
robocopy "C:\Users\pardone\My Documents" "F:\HP6910pDailyBackup\My Documents" /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogDocuments.txt
robocopy "C:\Users\pardone\Desktop\Scripts" "F:\HP6910pDailyBackup\Logs" BackUpLogDocuments.txt
rename F:\HP6910pDailyBackup\Logs\BackUpLogDocuments.txt BackUpLogDocuments_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del "C:\Users\pardone\Desktop\Scripts\BackUpLogDocuments.txt"
echo My Documents Copy Completed: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo Details are in BackUpLogDocuments_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:\HP6910pDailyBackup\Logs >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt


echo Favorites Copy Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
robocopy "C:\Users\pardone\Favorites" "F:\HP6910pDailyBackup\Favorites" /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogFavorites.txt
robocopy "C:\Users\pardone\Desktop\Scripts" "F:\HP6910pDailyBackup\Logs" BackUpLogFavorites.txt
rename F:\HP6910pDailyBackup\Logs\BackUpLogFavorites.txt BackUpLogFavorites_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del "C:\Users\pardone\Desktop\Scripts\BackUpLogFavorites.txt"
echo Favorites Copy Completed: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo Details are in BackUpLogFavorites_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:\HP6910pDailyBackup\Logs >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt


echo Firefox Copy Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
robocopy "C:\Users\pardone\AppData\Roaming\Mozilla\Firefox" "F:\HP6910pDailyBackup\Firefox" /MIR /COPY:DT /FFT /MT:50 /LOG:BackUpLogFirefox.txt
robocopy "C:\Users\pardone\Desktop\Scripts" "F:\HP6910pDailyBackup\Logs" BackUpLogFirefox.txt
rename F:\HP6910pDailyBackup\Logs\BackUpLogFirefox.txt BackUpLogFirefox_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
del "C:\Users\pardone\Desktop\Scripts\BackUpLogFirefox.txt"
echo Firefox Copy Completed: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo Details are in BackUpLogFirefox_%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt Located @ F:\HP6910pDailyBackup\Logs >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt


rem start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
rem echo Firefox Application Started: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt

echo BackUp Finished: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
echo ==================================================:  %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt





:NOT_EXIST
rem echo BackUp Did Not Run: %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
rem Echo DRIVE F: IS NOT READY >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
rem echo ==================================================:  %Date% %time% >> C:\Users\pardone\Desktop\Scripts\BackUpLog.txt
rem GOTO END

:END
Backup.txt
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros