Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > Batch file Xcopy without manual F

Batch file Xcopy without manual F

Forum Windows XP : Windows XP General Discussion - Batch file Xcopy without manual F

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

All of the batch files we are using in our windows scheduler work except the batch file below.

xcopy C:\Webs\zUpFtp.txt C:\Webs\UpFtp_Products\zProducts_%date:~4,2%-%date:~7,2%-%date:~10%.txt /y

===

C:\Batch_Files>xcopy C:\Webs\zUpFtp.txt C:\Webs\UpFtp_Products\zProducts_01-11-2
009.txt /y
Does C:\Webs\UpFtp_Products\zProducts_01-11-2009.txt specify a file name
or directory name on the target
(F = file, D = directory)?

===
Any suggestions at to how we can eliminate a manual [ F ]

Sponsored Links
Register or log in to remove.

xcopy copy does not know how you want to handle the destination. I would recommend you xcopy /? to display a list of switches. In your case your have two choices. If i remember correctly copy command use to copy 1file a time, xcopy however, can copy a whole folder plust subdir if correct switch is used

1. use copy command instead of xcopy
2. add /I switch right behind the /Y switch, this usually does the trick in copying the whole folder. I'm not specifically sure for file, but i bet it should silently/automatically copy it for you.

Reply to GreenMark

GreenMark wrote :

xcopy copy does not know how you want to handle the destination. I would recommend you xcopy /? to display a list of switches. In your case your have two choices. If i remember correctly copy command use to copy 1file a time, xcopy however, can copy a whole folder plust subdir if correct switch is used

1. use copy command instead of xcopy
2. add /I switch right behind the /Y switch, this usually does the trick in copying the whole folder. I'm not specifically sure for file, but i bet it should silently/automatically copy it for you.



I managed to overcome that only by supplying that 'f' letter from the additional input file, as follows:

xcopy src dst < dummyf.txt

where dummyf.txt consists of a single letter 'f'

Reply to grigorym

Hey guys,

I had to deal with a similar problem today and found this somewhere.


instead from a file "dummy.txt" you can echo 'f' - for file or 'd' for directory before the xcopy command using pipe symbol "|" on the same line.



echo f | xcopy source_folder\file.txt destination_folder\file.txt

or

echo d | xcopy source_folder\file.txt destination_folder\file.txt

Hope this helps!

Venny 【ツ】



Reply to Anonymous
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > Batch file Xcopy without manual F
Go to:

There are 1282 identified and unidentified users. To see the list of identified users, Click here.

Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them