Anwering "F" in a batch file - Is this a file or directory?

FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET date=%mm%%dd%%yyyy%
cd "C:\Program Files\MySQL\MySQL Server 4.1\bin"
mysqldump --user=root --password=somepwd elearn > elearn.sql
XCOPY /y /f elearn.sql "C:\ITD__DATA\elearnDB-mysqlFormat-%DATE%.sql"

REM HERE IS WHERE I AM PROMPTED THE FIRST TIME!

DEL elearn.sql
cd "C:\Documents and Settings\Administrator\Desktop\backupElearn"
NET STOP /y "IIS Admin Service"
"C:\Program Files\7-Zip\7z.exe" a -tzip archive.zip @listfile_.txt
NET START "IIS Admin Service"
NET START "Simple Mail Transport Protocol (SMTP)"
NET START "World Wide Web Publishing Service"
XCOPY /y /f archive.zip e:\bax2BPulled\elearnComplete-%DATE%.zip

REM HERE IS WHERE I AM PROMPTED THE SECOND TIME!

DEL archive.zip
DEL "C:\ITD__DATA\elearnDB-mysqlFormat-%DATE%.sql"
EXIT



When running the above batch file I am prompted 2 separate times "Is this a file or directory" (happens when creating/copying files).

What can I add to the batch file that will auto-answer "F" for file? As it is I have to manually type "F" for the batch to proceed.
LVL 2
smetterdAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Dufo G. BelskiConnect With a Mentor Retired bureaucrat/desktop supportCommented:
I think you can use echo, as in

echo f | XCOPY /y /f elearn.sql "C:\ITD__DATA\elearnDB-mysqlFormat-%DATE%.sql"  where | is the pipe character above the backslash.
0
All Courses

From novice to tech pro — start learning today.