XCOPY Prompt

G

Gene Wirchenko

[snip]
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*.
I have a batch file to keep it simple. Just type the name of the
batch file, press <Enter>, and done. It does not get much simpler
than that once one gets it working. Mousing about has to be repeated
ad nauseum.

Sincerely,

Gene Wirchenko
 
G

Gene Wirchenko

[snip]
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.
I did. A filename is source and is a destination.

Sincerely,

Gene Wirchenko
 
B

Bob Hatch

[snip]
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.
I did. A filename is source and is a destination.

Sincerely,

Gene Wirchenko
I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?
 
K

Ken Springer

[snip]
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*.
I have a batch file to keep it simple. Just type the name of the
batch file, press<Enter>, and done. It does not get much simpler
than that once one gets it working. Mousing about has to be repeated
ad nauseum.
Unless you use a macro recorder and have a shortcut to it. :)


--
Ken

Mac OS X 10.6.8
Firefox 12.0
Thunderbird 12.0
LibreOffice 3.5.1.2
 
G

Gene Wirchenko

[snip]
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*.
I have a batch file to keep it simple. Just type the name of the
batch file, press<Enter>, and done. It does not get much simpler
than that once one gets it working. Mousing about has to be repeated
ad nauseum.
Unless you use a macro recorder and have a shortcut to it. :)
Since many of my actions could not be done in a GUI, that would
not work.

Sincerely,

Gene Wirchenko
 
G

Gene Wirchenko

[snip]
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.
I did. A filename is source and is a destination.
I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?
I gave you the exact command lines. Since neither drives nor
directories were specified, the default ones apply.

Sincerely,

Gene Wirchenko
 
C

Char Jackson

[snip]

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.

I did. A filename is source and is a destination.
I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?
I gave you the exact command lines. Since neither drives nor
directories were specified, the default ones apply.
I never saw any feedback as to whether my suggestion to use "echo f"
was working for you, as spelled out here: (I assume it did.)
Message-ID: <[email protected]>

That seemed to work for me, as did changing from xcopy to the copy
command. The prompt you're seeing doesn't occur with copy.
 
C

choro

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.
No need for xcopy at all. Just open the file, *Save as...* and give it a
different filename -- may I suggest a dash or an underscore just before
the dot and the file extension e.g. Filename-.doc or Filename_.doc And
it's done! And you have 2 copies in the same folder.
-- choro
 
C

choro

[snip]
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.
I did. A filename is source and is a destination.

Sincerely,

Gene Wirchenko
I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?
Oh, my God! This is beginning to sound like that story of the computing
teacher getting a phone call in the middle of the night from the old
lady asking what could she do since her mouse was already at the edge of
the desk and she still had to move it a bit more to click whatever she
was going to click!
-- choro
 
G

Gene E. Bloch

[snip]

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.

I did. A filename is source and is a destination.

Sincerely,

Gene Wirchenko
I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?
Oh, my God! This is beginning to sound like that story of the computing
teacher getting a phone call in the middle of the night from the old lady
asking what could she do since her mouse was already at the edge of the desk
and she still had to move it a bit more to click whatever she was going to
click!
-- choro
I like the analogy :)
 
C

Char Jackson

On 25/04/2012 02:39, Char Jackson wrote:

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.
No need for xcopy at all. Just open the file, *Save as...* and give it a
different filename -- may I suggest a dash or an underscore just before
the dot and the file extension e.g. Filename-.doc or Filename_.doc And
it's done! And you have 2 copies in the same folder.
There's no need to open any files. You seem to have a knack for coming
up with convoluted solutions. :)
 
B

Bob Hatch

[snip]

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.

I did. A filename is source and is a destination.
I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?
I gave you the exact command lines. Since neither drives nor
directories were specified, the default ones apply.

Sincerely,

Gene Wirchenko
You're right. It's most likely a broken OS on your machine and something
you can most likely fix on your own. :-(
 
C

Char Jackson

On 4/25/2012 9:37 AM, Gene Wirchenko wrote:
[snip]

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.

I did. A filename is source and is a destination.
I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?
I gave you the exact command lines. Since neither drives nor
directories were specified, the default ones apply.

Sincerely,

Gene Wirchenko
You're right. It's most likely a broken OS on your machine and something
you can most likely fix on your own. :-(
Are you saying it works differently on your machine? If so, perhaps
it's your machine that's broken.
 
B

Bob Hatch

On 4/25/2012 9:37 AM, Gene Wirchenko wrote:
[snip]

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.

I did. A filename is source and is a destination.

I had, based on your post, assumed (I know, shouldn't do that) that you
were copying the file to a new location and renaming it at the same
time. What's the drive designation of the USB stick? E, F, G?

I gave you the exact command lines. Since neither drives nor
directories were specified, the default ones apply.

Sincerely,

Gene Wirchenko
You're right. It's most likely a broken OS on your machine and something
you can most likely fix on your own. :-(
Are you saying it works differently on your machine? If so, perhaps
it's your machine that's broken.
Every batch file I've ever written to do xcopy or copy has required me
to specify the location of the action to be taken because I run the
batch file from the desktop, it took me a while, but I finally got that
he was placing everything in the c:\Users\"whatevername" directory and
working from there.

If I write a batch file similar to the OP's and use copy rather than
xcopy, and use file names identical to the OP's except with a .txt
extension and place the batch file in c:\users\bob hatch it works.

My batch file looks like this:
echo on
copy WorkFunctionCodes_New.txt WFCNew.txt /y/v
copy WorkFunctionCodes_New_Process01.txt WFCNP01.txt /y/v


The /y suppresses prompting to confirm over writing an existing file and
eliminates the need to delete the old files.

If I use the xcopy command, I get the same error he gets. No error with
the copy command.

My confusion came about because when he mentioned the USB stick, I
assumed, and yes I shouldn't have done that, that he was trying to do
this on the USB stick, which is what I would do if I were trying to
accomplish the same task. Or maybe I wouldn't. I would most likely add 4
lines at the end of the batch file to copy them to the USB stick if I
wanted all files on the USB stick, 2 lines if I only wanted the short
named ones, and I would use the copy command, not xcopy. I use xcopy to
copy entire directories, not single files.

Part of the problem is that I think that others will do things the same
way I would, and that's another thing I shouldn't do.
 
S

Steve Hayes

Every batch file I've ever written to do xcopy or copy has required me
to specify the location of the action to be taken because I run the
batch file from the desktop, it took me a while, but I finally got that
he was placing everything in the c:\Users\"whatevername" directory and
working from there.
I've never been able to find the Desktop to run anything from

For what it's worth, this is the batchfile I use to copy files to my flash
drive to use on my laptop (where I have another batch file to copy them on to
the hard drive there. The file is DSK2FLSH.BAT and the flash drive is drive J:

echo Copying transfer files from Steve's Desktop to Flash ROM
c:
Echo Copying FHS files
e:
cd \Family\Famhist
move *.fil f:\FHSBack
pause
move *.tmp f:\FHSback
move *.ged f:\FHSback
pause
move *.bak f:\FHSback
pause
Echo Copying askSam files
cd \asksam
move *.tmp f:\tempback
move *.bak f:\tempback
move *.sav f:\tempback
cd \inmagic
move *.tmp f:\tempback
move *.bak f:\tempback
Echo Archiving data files
f:
cd \Archives
arj u -r FHSTrans e:\family
arj u -r Inmagic e:\Inmagic
arj u -r Textfile g:\Textfile
arj u -r AskSam e:\asksam
arj u -r rdfFiles e:\paf\rdfdata\*.doc
arj u -r rdfFiles e:\paf\rdfdata\*.dat
arj u -r askSam4 g:\stevedoc\*.ask
arj u -r jotnote g:\stevedoc\*.jot
arj u -r PAF4file g:\stevedoc\*.paf
arj u -r htmldocs e:\html\*.htm
arj u -r htmldocs e:\html\*.jpg
arj u -r htmldocs e:\html\*.gif
arj d Inmagic *.tmp
arj d Textfile *.tmp
bac *.arj j:
Echo Copying Legacy data files
e:
cd \Legacy\Data
move *.tmp f:\tempback
move *.bak f:\tempback
move *.zip f:\tempback
move *.jpg f:\tempback
move *.tmp f:\tempback
move *.doc f:\tempback
bac *.* j:\Legacy\Data
cd \Legacy\Pictures
move *.doc f:\tempback
move *.zip f:\tempback
move *.lnk f:\tempback
bac *.* j:\Legacy\Pictures
j:
cd \Legacy\Data
move *.tmp f:\tempback
move *.bak f:\tempback
move *.zip f:\tempback
move *.jpg f:\tempback
move *.tmp f:\tempback
move *.doc f:\tempback
move *.lnk f:\tempback
cd \Legacy\Pictures
move *.doc f:\tempback
move *.zip f:\tempback
move *.lnk f:\tempback
move *.bak f:\tempback
move *.dat f:\tempback
move *.txt f:\tempback
cd \
c:
cd \windows
bac outlook.pst j:\
e:
cd \Treepad
bac *.hjt j:\
pause
Dir j:
pause

And the one to copy them back again when I've been working on the laptop is
FLSH2DSK.BAT:

echo Copying files from Flash drive to Steve's desktop computer
pause
e:
cd \
arj x -u -y j:asksam
arj x -u -y j:inmagic
arj x -u -y j:FHSTrans
arj x -u -y j:rdffiles
arj x -u -y j:htmldocs
g:
cd \
arj x -u -y j:Textfile
arj x -u -y j:asksam4
arj x -u -y j:pAF4file
arj x -u -y j:jotnote
j:
cd \legacy\data
bac *.* e:\legacy\data
cd \legacy\pictures
bac *.* e:\legacy\pictures
cd \
bac outlook.pst c:\windows
bac *.hjt e:\Treepad
pause
exit

As in the OP's question, the BAC.COM command is an old DOS command that only
understands 8.3 filenames.

I use it because it copies files to the destination only when there is a newer
version on the source drive. If the versions are the same it does not copy.

There are also some extraneous move commands. They are there because if I
should type the command when the flash drive is not plugged in, it copies some
files to the wrong directories, and the move command moves them out if it
finds them there. It also moves old backup files.
 
Z

Zaphod Beeblebrox

On Thu, 26 Apr 2012 18:48:16 +0200, "Steve Hayes"
As in the OP's question, the BAC.COM command is an old DOS command that only
understands 8.3 filenames.
And as a consequence it is a 16-Bit program, so it won't run under
Windows 7 64-Bit natively (though it will in XP Mode).

Just in case someone doesn't realize that...
 
S

Steve Hayes

On Thu, 26 Apr 2012 18:48:16 +0200, "Steve Hayes"

And as a consequence it is a 16-Bit program, so it won't run under
Windows 7 64-Bit natively (though it will in XP Mode).
Which is one of the reasons I switched to Windows 7 32-bit on my laptop (which
luckily came with a DVD with the 32-bit system on it).
 
B

Bob Hatch

I've never been able to find the Desktop to run anything from

For what it's worth, this is the batchfile I use to copy files to my flash
drive to use on my laptop (where I have another batch file to copy them on to
the hard drive there. The file is DSK2FLSH.BAT and the flash drive is drive J:

echo Copying transfer files from Steve's Desktop to Flash ROM
c:
Echo Copying FHS files
e:
cd \Family\Famhist
move *.fil f:\FHSBack
pause
move *.tmp f:\FHSback
move *.ged f:\FHSback
pause
move *.bak f:\FHSback
pause
Echo Copying askSam files
cd \asksam
move *.tmp f:\tempback
move *.bak f:\tempback
move *.sav f:\tempback
cd \inmagic
move *.tmp f:\tempback
move *.bak f:\tempback
Echo Archiving data files
f:
cd \Archives
arj u -r FHSTrans e:\family
arj u -r Inmagic e:\Inmagic
arj u -r Textfile g:\Textfile
arj u -r AskSam e:\asksam
arj u -r rdfFiles e:\paf\rdfdata\*.doc
arj u -r rdfFiles e:\paf\rdfdata\*.dat
arj u -r askSam4 g:\stevedoc\*.ask
arj u -r jotnote g:\stevedoc\*.jot
arj u -r PAF4file g:\stevedoc\*.paf
arj u -r htmldocs e:\html\*.htm
arj u -r htmldocs e:\html\*.jpg
arj u -r htmldocs e:\html\*.gif
arj d Inmagic *.tmp
arj d Textfile *.tmp
bac *.arj j:
Echo Copying Legacy data files
e:
cd \Legacy\Data
move *.tmp f:\tempback
move *.bak f:\tempback
move *.zip f:\tempback
move *.jpg f:\tempback
move *.tmp f:\tempback
move *.doc f:\tempback
bac *.* j:\Legacy\Data
cd \Legacy\Pictures
move *.doc f:\tempback
move *.zip f:\tempback
move *.lnk f:\tempback
bac *.* j:\Legacy\Pictures
j:
cd \Legacy\Data
move *.tmp f:\tempback
move *.bak f:\tempback
move *.zip f:\tempback
move *.jpg f:\tempback
move *.tmp f:\tempback
move *.doc f:\tempback
move *.lnk f:\tempback
cd \Legacy\Pictures
move *.doc f:\tempback
move *.zip f:\tempback
move *.lnk f:\tempback
move *.bak f:\tempback
move *.dat f:\tempback
move *.txt f:\tempback
cd \
c:
cd \windows
bac outlook.pst j:\
e:
cd \Treepad
bac *.hjt j:\
pause
Dir j:
pause

And the one to copy them back again when I've been working on the laptop is
FLSH2DSK.BAT:

echo Copying files from Flash drive to Steve's desktop computer
pause
e:
cd \
arj x -u -y j:asksam
arj x -u -y j:inmagic
arj x -u -y j:FHSTrans
arj x -u -y j:rdffiles
arj x -u -y j:htmldocs
g:
cd \
arj x -u -y j:Textfile
arj x -u -y j:asksam4
arj x -u -y j:pAF4file
arj x -u -y j:jotnote
j:
cd \legacy\data
bac *.* e:\legacy\data
cd \legacy\pictures
bac *.* e:\legacy\pictures
cd \
bac outlook.pst c:\windows
bac *.hjt e:\Treepad
pause
exit

As in the OP's question, the BAC.COM command is an old DOS command that only
understands 8.3 filenames.

I use it because it copies files to the destination only when there is a newer
version on the source drive. If the versions are the same it does not copy.

There are also some extraneous move commands. They are there because if I
should type the command when the flash drive is not plugged in, it copies some
files to the wrong directories, and the move command moves them out if it
finds them there. It also moves old backup files.
And this is the batch file I use to copy pictures to my wife's laptop.

rem This is the program to Backup files to Marys Laptop computer.
cls
echo off
echo This program will Backup jpg pictures from Drive D to Marys Drive D.
rem
rem
rem
rem
echo To continue with the Backup Process press any key.


pause

echo on

cls
d:
cd pictures

U:
cd Pictures

d:
xcopy *.jpg U: /D/S/Y
exit


The switch's do the following.

/D Copies files whose sourse time is newer than the destination time.
/S Copies directories and sub-directories, except empty ones.
/Y Suppresses propting to confirm you waht to overwrite on existing
destination file.

The file is on, what Windows calls, the desktop. Click on the batch file
and away we go. :)
 
C

Char Jackson

And this is the batch file I use to copy pictures to my wife's laptop.

rem This is the program to Backup files to Marys Laptop computer.
cls
echo off
echo This program will Backup jpg pictures from Drive D to Marys Drive D.
rem
rem
rem
rem
echo To continue with the Backup Process press any key.


pause
I probably would have written the header like this:

cls
echo off
echo This program will backup jpg pics from Drive D to Marys Drive D.
pause

echo on

cls
d:
cd pictures

U:
cd Pictures

d:
xcopy *.jpg U: /D/S/Y
exit
What does the following code block do?
d:
cd pictures
U:
cd Pictures

Why not replace 6 lines of code (the 4 I asked about plus the next
two) with a single fully qualified xcopy command?

Just curious. :)
 
G

Gene E. Bloch

I probably would have written the header like this:
cls
echo off
echo This program will backup jpg pics from Drive D to Marys Drive D.
pause
What does the following code block do?
d:
cd pictures
U:
cd Pictures
Why not replace 6 lines of code (the 4 I asked about plus the next
two) with a single fully qualified xcopy command?
Just curious. :)
Those four lines replace the simpler use of qualified pathnames :)

Oh, never mind, I suddenly realized what you're saying ;-)

Please stop this subtlety thing...
 

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