XCOPY Prompt

G

Gene Wirchenko

Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
del WFCNP01.asp
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v

Unfortunately, xcopy always asks me if the destination is a file
or a directory. I can not see, in the switches, what to specify to
say that it is always to be a file. Note that I am always copying ONE
file. (Yes, I have verified that it is only one file to be copied per
xcopy command.)

What switch setting do I need, please?

Sincerely,

Gene Wirchenko
 
B

BillW50

Gene Wirchenko said:
Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
del WFCNP01.asp
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v

Unfortunately, xcopy always asks me if the destination is a file
or a directory. I can not see, in the switches, what to specify to
say that it is always to be a file. Note that I am always copying ONE
file. (Yes, I have verified that it is only one file to be copied per
xcopy command.)

What switch setting do I need, please?
They have to be in 8.3 format? If not, why not make everything easy by
using the free SyncBack?
 
B

Bob Hatch

Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
del WFCNP01.asp
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v

Unfortunately, xcopy always asks me if the destination is a file
or a directory. I can not see, in the switches, what to specify to
say that it is always to be a file. Note that I am always copying ONE
file. (Yes, I have verified that it is only one file to be copied per
xcopy command.)

What switch setting do I need, please?

Sincerely,

Gene Wirchenko
I don't see a source and/or destination in your batch file.

If the file is already on the USB stick, why don't use just use ren or
rename?
 
S

Steve Hayes

Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
del WFCNP01.asp
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v

Unfortunately, xcopy always asks me if the destination is a file
or a directory. I can not see, in the switches, what to specify to
say that it is always to be a file. Note that I am always copying ONE
file. (Yes, I have verified that it is only one file to be copied per
xcopy command.)

What switch setting do I need, please?
Now that's something I'd also like to know.
 
K

Ken Springer

Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
del WFCNP01.asp
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v

Unfortunately, xcopy always asks me if the destination is a file
or a directory. I can not see, in the switches, what to specify to
say that it is always to be a file. Note that I am always copying ONE
file. (Yes, I have verified that it is only one file to be copied per
xcopy command.)

What switch setting do I need, please?
To ask a dumb question, Gene, since you are just copying one file at a
time, and not an entire directory of files, why not use the copy command
instead?

--
Ken

Mac OS X 10.6.8
Firefox 11.0
Thunderbird 11.0.1
LibreOffice 3.5.1.2
 
B

Bob Hatch

Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
del WFCNP01.asp
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v

Unfortunately, xcopy always asks me if the destination is a file
or a directory. I can not see, in the switches, what to specify to
say that it is always to be a file. Note that I am always copying ONE
file. (Yes, I have verified that it is only one file to be copied per
xcopy command.)

What switch setting do I need, please?

Sincerely,

Gene Wirchenko
Let me be more clear. Your xcopy (could just as easily be copy) should
read something like:

xcopy c:\my documents\WorkFunctionCodes_New.asp f: WFCNew.asp /v

You have no source for the file and no destination for the file. The
xcopy command doesn't know where the file is and where it should go.
Open a cmd window, type help xcopy and learn how to use a dos type
command line.

If I were doing this I would first copy the files, then do a ren command
on the usb stick, so my batch file would be:

echo on
cd F: (assumes F: is the USB Stick drive designation)
del WFCNew.asp
del WFCNP01.asp
copy c:\directory where file is\WorkFunctionCodes_New.asp F: (assumes F:
is the USB stick).
copy c:\directory where file is\WorkFunctionCodes_New_Process01.asp F:
ren WorkFunctionCodes_New.asp WFCNew.asp
ren WorkFunctionCodes_New_Process01.asp WFCNP01.asp
exit

you may have to use " " around long file names.
 
T

Tecknomage

Let me be more clear. Your xcopy (could just as easily be copy) should
read something like:

xcopy c:\my documents\WorkFunctionCodes_New.asp f: WFCNew.asp /v

You have no source for the file and no destination for the file. The
xcopy command doesn't know where the file is and where it should go.
Open a cmd window, type help xcopy and learn how to use a dos type
command line.

If I were doing this I would first copy the files, then do a ren command
on the usb stick, so my batch file would be:

echo on
cd F: (assumes F: is the USB Stick drive designation)
del WFCNew.asp
del WFCNP01.asp
copy c:\directory where file is\WorkFunctionCodes_New.asp F: (assumes F:
is the USB stick).
copy c:\directory where file is\WorkFunctionCodes_New_Process01.asp F:
ren WorkFunctionCodes_New.asp WFCNew.asp
ren WorkFunctionCodes_New_Process01.asp WFCNP01.asp
exit

you may have to use " " around long file names.

The above command-line will NOT work, should be:

xcopy "c:\my documents\WorkFunctionCodes_New.asp" f:\WFCNew.asp /v

You are asked if destination is file or directory because it was
phrased incorrectly. Note that if the destination includes a space
(like source above) you must include the quotes. Remember XCOPY is a
DOS function and does not understand spaces.


--
=========== Tecknomage ===========
Computer Systems Specialist
ComputerHelpForum.org Staff Member
IT Technician
San Diego, CA
 
G

Gene Wirchenko

^1^^^^^^^^^^^^^^^^^^^^^^^ ^2^^^^^^^^
1 is the source; 2 is the destination.

[snip]
I don't see a source and/or destination in your batch file.

If the file is already on the USB stick, why don't use just use ren or
rename?
I want a copy with a different name.

Sincerely,

Gene Wirchenko
 
G

Gene Wirchenko

On 4/23/2012 2:18 PM, Gene Wirchenko wrote:
[snip]
[snip]
[snip]
You have no source for the file and no destination for the file. The
Sure I do. I mean to copy within the current diretory of the
current drive.

I was using a cmd window. I have been using them for three
decades.

Yes, but since I want to COPY, not rename, files, your solution
is incorrect.

[snip]
The above command-line will NOT work, should be:

xcopy "c:\my documents\WorkFunctionCodes_New.asp" f:\WFCNew.asp /v

You are asked if destination is file or directory because it was
phrased incorrectly. Note that if the destination includes a space
(like source above) you must include the quotes. Remember XCOPY is a
DOS function and does not understand spaces.
What was the error in my original commands? They did not have
spaces in the filenames.

Sincerely,

Gene Wirchenko
 
B

Bob Hatch

On 4/23/2012 2:18 PM, Gene Wirchenko wrote:
[snip]
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
[snip]
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v
[snip]
You have no source for the file and no destination for the file. The
Sure I do. I mean to copy within the current diretory of the
current drive.

I was using a cmd window. I have been using them for three
decades.

Yes, but since I want to COPY, not rename, files, your solution
is incorrect.

[snip]
The above command-line will NOT work, should be:

xcopy "c:\my documents\WorkFunctionCodes_New.asp" f:\WFCNew.asp /v

You are asked if destination is file or directory because it was
phrased incorrectly. Note that if the destination includes a space
(like source above) you must include the quotes. Remember XCOPY is a
DOS function and does not understand spaces.
What was the error in my original commands? They did not have
spaces in the filenames.
Once again, YOU DID NOT HAVE A SOURCE AND DESTINATION for the file. You
must have a SOURCE AND DESTINATION for copy or xcopy to work. It's not
an optional thing.
 
Z

Zaphod Beeblebrox

On Tue, 24 Apr 2012 11:41:32 -0700, "Bob Hatch" <[email protected]>
wrote in article <4f96f3dd$0$2326$c3e8da3$38634283
@news.astraweb.com>...
On 4/23/2012 2:18 PM, Gene Wirchenko wrote:
[snip]

xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
[snip]

xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v
[snip]

You have no source for the file and no destination for the file. The
Sure I do. I mean to copy within the current diretory of the
current drive.
xcopy command doesn't know where the file is and where it should go.
Open a cmd window, type help xcopy and learn how to use a dos type
command line.
I was using a cmd window. I have been using them for three
decades.
If I were doing this I would first copy the files, then do a ren command
on the usb stick, so my batch file would be:
Yes, but since I want to COPY, not rename, files, your solution
is incorrect.

[snip]
The above command-line will NOT work, should be:

xcopy "c:\my documents\WorkFunctionCodes_New.asp" f:\WFCNew.asp /v

You are asked if destination is file or directory because it was
phrased incorrectly. Note that if the destination includes a space
(like source above) you must include the quotes. Remember XCOPY is a
DOS function and does not understand spaces.
What was the error in my original commands? They did not have
spaces in the filenames.
Once again, YOU DID NOT HAVE A SOURCE AND DESTINATION for the file. You
must have a SOURCE AND DESTINATION for copy or xcopy to work. It's not
an optional thing.
Yes, it is. Gene specified source and destination file names, and the
current directory is assumed if no source or destination directory is
specified. This is standard behavior since the early DOS days.
 
B

Bob Hatch

The above command-line will NOT work, should be:

xcopy "c:\my documents\WorkFunctionCodes_New.asp" f:\WFCNew.asp /v
Right. Thank you, but he did not have a source and destination for the
file, therefore the batch file will not work.
 
C

Char Jackson

Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
del WFCNP01.asp
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v

Unfortunately, xcopy always asks me if the destination is a file
or a directory. I can not see, in the switches, what to specify to
say that it is always to be a file. Note that I am always copying ONE
file. (Yes, I have verified that it is only one file to be copied per
xcopy command.)

What switch setting do I need, please?
I didn't do any torture testing, but this seems to work:

prefix "echo f | " to your xcopy commands, thus:

xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
becomes
echo f | xcopy WorkFunctionCodes_New.asp WFCNew.asp /v

and
xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v
becomes
echo f | xcopy WorkFunctionCodes_New_Process01.asp WFCNP01.asp /v
 
C

Char Jackson

Right. Thank you, but he did not have a source and destination for the
file, therefore the batch file will not work.
As others have said, you don't need to specify a path when you're
working in the current directory. That behavior has been standard
since the early days of DOS.
 
C

choro

^1^^^^^^^^^^^^^^^^^^^^^^^ ^2^^^^^^^^
1 is the source; 2 is the destination.

[snip]
I don't see a source and/or destination in your batch file.

If the file is already on the USB stick, why don't use just use ren or
rename?
I want a copy with a different name.
The simplest way is to copy and paste the file to another folder, rename
it there and then drag and drop it to the original folder. IF they are
in different drives then use the CUT & PASTE method.If you want both
copies of the file in the same folder that is...

Remember the motto, *Keep it simple*.
-- choro
 
B

Bob Hatch

As others have said, you don't need to specify a path when you're
working in the current directory. That behavior has been standard
since the early days of DOS.
Agreed, but in that case he needs to change the to the drive/directory/
in the batch file, and use copy, not xcopy. There is no reason to use
xcopy for a single file copy. :)
 
C

Char Jackson

Agreed, but in that case he needs to change the to the drive/directory/
in the batch file,
I think the presumption is that he already did that, even though he
didn't show us that part. The script would have failed in a much
different way if he had failed to do that.
and use copy, not xcopy. There is no reason to use
xcopy for a single file copy. :)
I, too, wondered why he didn't simply use the copy command, which
cleanly gets around the issue he's currently having. OTOH, I posted a
solution to his xcopy issue earlier today, so I guess he can use xcopy
if he wants to.
 
C

Char Jackson

On 4/23/2012 2:18 PM, Gene Wirchenko wrote:
Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
^1^^^^^^^^^^^^^^^^^^^^^^^ ^2^^^^^^^^
1 is the source; 2 is the destination.

[snip]
I don't see a source and/or destination in your batch file.

If the file is already on the USB stick, why don't use just use ren or
rename?
I want a copy with a different name.
The simplest way is to copy and paste the file to another folder, rename
it there and then drag and drop it to the original folder. IF they are
in different drives then use the CUT & PASTE method.If you want both
copies of the file in the same folder that is...

Remember the motto, *Keep it simple*.
There's nothing "simple" about all of that rigmarole. I fail to see
the reason, and I fail to see why it would be any easier, to rename
files in one folder versus another. Just rename them where they lie.
 
C

choro

On 4/23/2012 2:18 PM, Gene Wirchenko wrote:
Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
^1^^^^^^^^^^^^^^^^^^^^^^^ ^2^^^^^^^^
1 is the source; 2 is the destination.

[snip]

I don't see a source and/or destination in your batch file.

If the file is already on the USB stick, why don't use just use ren or
rename?

I want a copy with a different name.
The simplest way is to copy and paste the file to another folder, rename
it there and then drag and drop it to the original folder. IF they are
in different drives then use the CUT& PASTE method.If you want both
copies of the file in the same folder that is...

Remember the motto, *Keep it simple*.
There's nothing "simple" about all of that rigmarole. I fail to see
the reason, and I fail to see why it would be any easier, to rename
files in one folder versus another. Just rename them where they lie.
But I thought he wanted *two* copies of the same file under different
names. Hence my suggestion... Got it?!

Otherwise you can rename a file in loco as you suggest. But you cannot
rename a file in loco and still retain the old version with the old
original filename.
-- choro
 
C

Char Jackson

On 24/04/2012 17:51, Gene Wirchenko wrote:
On 4/23/2012 2:18 PM, Gene Wirchenko wrote:
Dear Win7ers:

I am working between two systems: an XP system and a 7 system. I
copy files back and forth on a USB stick. Some of the filenames are
long, and I have old utility software that is limited to the 8.3 file
format. I need short filenames, and I can not trust the the short
names generated by Windows will be consistent.

I created a batch file to make a short filename version:
del WFCNew.asp
xcopy WorkFunctionCodes_New.asp WFCNew.asp /v
^1^^^^^^^^^^^^^^^^^^^^^^^ ^2^^^^^^^^
1 is the source; 2 is the destination.

[snip]

I don't see a source and/or destination in your batch file.

If the file is already on the USB stick, why don't use just use ren or
rename?

I want a copy with a different name.

The simplest way is to copy and paste the file to another folder, rename
it there and then drag and drop it to the original folder. IF they are
in different drives then use the CUT& PASTE method.If you want both
copies of the file in the same folder that is...

Remember the motto, *Keep it simple*.
There's nothing "simple" about all of that rigmarole. I fail to see
the reason, and I fail to see why it would be any easier, to rename
files in one folder versus another. Just rename them where they lie.
But I thought he wanted *two* copies of the same file under different
names. Hence my suggestion... Got it?!
That's where xcopy (and copy, etc.) come in. They do exactly that, but
without requiring you to move files somewhere else first.
Otherwise you can rename a file in loco as you suggest. But you cannot
rename a file in loco and still retain the old version with the old
original filename.
That's where xcopy (and copy, etc.) come in. They do exactly that, but
without requiring you to move files somewhere else first.

I sound like a broken record, but these kinds of basic file operations
are, well, basic. They've been with us for over 30 years now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top