Computer Hope

Microsoft => Microsoft DOS => Topic started by: DosDummy on July 29, 2006, 05:43:24 PM

Title: XCOPY - How to avoid the "FILE or Directory" messa
Post by: DosDummy on July 29, 2006, 05:43:24 PM
I've been using XCOPY forever and never figured out how to avoid the nasty message:
Does C:\NewPlace\Data.txt specify a file name or a directory name on the target (F = File, D = Directory)

Is there a way of saying up front that it is a file - so if someone other than me is running the batch file they don't get prompted with what they consider a meaningless question.  I looked at all the XCOPY options and didn't see anything that would help.

I am running XCOPY from the following .BAT file.

Thanx in advance!
Angelo

Code: [Select]
@echo off

for /F "tokens=1,2*" %%i in (H:\AppDevCtr\DistAppl\DataFile.txt) do xcopy %%i %%j /y /q /k

echo You are done!  ------------ but we have to get rid of that nagging file or directory message

pause
exit:
Title: Re: XCOPY - How to avoid the "FILE or Directory" m
Post by: Sidewinder on July 29, 2006, 06:18:10 PM
This was answered in your other post. Please don't double post as it confuses the natives. ;D