Batch files query



Bill Ridgeway
07-10-2005, 02:49 AM
On 17/06/2005 I raised the query

<<I have a batch file which copies key folders and files between hard
disks -

xcopy c:\progra~1\*.* /s d:\progra~1\progra~1\

It would seem that although it will accept only truncated folder and file
names (e.g. progra~1) for the source, sub folder and file names are written
to the target drive full length.

Am I right in thinking that source names have to be written in the truncated
form (after all it is, basically a DOS command)? if not how can this be
done?>>

Prompted by the reply from "Byte" I have discovered that the simple way of
preserving long names is to enclose the name (source and destination) in
quotes e.g.

xcopy c:\"program files"\*.* /e d:\"program files"\

I have also discovered that the flag /e also copies empty folders.

Regards.

Bill Ridgeway
Computer Solutions


Batch files query