Aleks
asked on
Problem with .bat program copying files
I have a .bat program which copies files from one hard drive to another, it reads:
---
@echo off
echo Starting backup process...
xCopy /E/Y C:\BDotAttachments\*.* E:\BDotDesktopBkp\BDotAtta chments
if %errorlevel% gtr 0 (
echo ERROR [%errorlevel%]: Backup process completed but with error(s).
) else (
echo Backup process completed successfully.
)
pause
---
But when I run it I get the error attached. Please advice.
Capture.PNG
---
@echo off
echo Starting backup process...
xCopy /E/Y C:\BDotAttachments\*.* E:\BDotDesktopBkp\BDotAtta
if %errorlevel% gtr 0 (
echo ERROR [%errorlevel%]: Backup process completed but with error(s).
) else (
echo Backup process completed successfully.
)
pause
---
But when I run it I get the error attached. Please advice.
Capture.PNG
Add the /i switch so you don't get the prompt and it makes the directory automatically
ASKER
thx .. seems to work. isn't 'pause' supposed to keep the window open at the end ? it closes :$
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.