A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows 7 » Windows 7 Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

xcopy Option?



 
 
Thread Tools Rate Thread Display Modes
  #1  
Old August 6th 12, 09:54 PM posted to alt.windows7.general
Gene Wirchenko
external usenet poster
 
Posts: 426
Default xcopy Option?

Dear Win7 Folk:

There seems to be an option missing in xcopy, but possibly, I am
overlooking it.

The documentation for the /i option states:
"If destination does not exist and copying more than one file, assumes
that destination must be a directory."

What I want is just like this but for file. IOW, I want an
option that behaves like:
"If destination does not exist and copying more than one file, assumes
that destination must be FILES."

I occasionally copy groups of files renaming them as I go. For
example:
xcopy *.html *.ht
I need to do this, because I have some utilities that only understand
8.3 filenames. This sets off xcopy's file/directory query.

I have kludged something by creating a file containing "f" and
attaching it to stdin:
xcopy ... shortf.dat
but this is a kludge and would likely cause trouble if there were a
different prompt.

Ideally, this should work in Windows XP (which as some of you
know, I still use).

Sincerely,

Gene Wirchenko
Ads
  #2  
Old August 6th 12, 11:07 PM posted to alt.windows7.general
Roger Mills[_2_]
external usenet poster
 
Posts: 332
Default xcopy Option?

On 06/08/2012 21:54, Gene Wirchenko wrote:
Dear Win7 Folk:

There seems to be an option missing in xcopy, but possibly, I am
overlooking it.

The documentation for the /i option states:
"If destination does not exist and copying more than one file, assumes
that destination must be a directory."

What I want is just like this but for file. IOW, I want an
option that behaves like:
"If destination does not exist and copying more than one file, assumes
that destination must be FILES."

I occasionally copy groups of files renaming them as I go. For
example:
xcopy *.html *.ht
I need to do this, because I have some utilities that only understand
8.3 filenames. This sets off xcopy's file/directory query.

I have kludged something by creating a file containing "f" and
attaching it to stdin:
xcopy ...shortf.dat
but this is a kludge and would likely cause trouble if there were a
different prompt.

Ideally, this should work in Windows XP (which as some of you
know, I still use).

Sincerely,

Gene Wirchenko



Have you tried xxcopy? This is a free (for personal use) third-party
application, which is like xcopy with a lot more bells and whistles. I
don't know whether it does exactly what you want, but it stands a good
chance.
--
Cheers,
Roger
____________
Please reply to Newsgroup. Whilst email address is valid, it is seldom
checked.
  #3  
Old August 6th 12, 11:20 PM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default xcopy Option?

On Mon, 06 Aug 2012 13:54:26 -0700, Gene Wirchenko wrote:

Dear Win7 Folk:

There seems to be an option missing in xcopy, but possibly, I am
overlooking it.

The documentation for the /i option states:
"If destination does not exist and copying more than one file, assumes
that destination must be a directory."

What I want is just like this but for file. IOW, I want an
option that behaves like:
"If destination does not exist and copying more than one file, assumes
that destination must be FILES."

I occasionally copy groups of files renaming them as I go. For
example:
xcopy *.html *.ht
I need to do this, because I have some utilities that only understand
8.3 filenames. This sets off xcopy's file/directory query.

I have kludged something by creating a file containing "f" and
attaching it to stdin:
xcopy ... shortf.dat
but this is a kludge and would likely cause trouble if there were a
different prompt.

Ideally, this should work in Windows XP (which as some of you
know, I still use).

Sincerely,

Gene Wirchenko


I suspect that it means "if the destination name on the command line
doesn't exist...".

But notice the switches /L and /U, and maybe /N.

--
Gene E. Bloch (Stumbling Bloch)
  #4  
Old August 7th 12, 01:44 AM posted to alt.windows7.general
Bob I
external usenet poster
 
Posts: 9,943
Default xcopy Option?

Have you tried

xcopy *.html ..\*.htm

On 8/6/2012 3:54 PM, Gene Wirchenko wrote:
Dear Win7 Folk:

There seems to be an option missing in xcopy, but possibly, I am
overlooking it.

The documentation for the /i option states:
"If destination does not exist and copying more than one file, assumes
that destination must be a directory."

What I want is just like this but for file. IOW, I want an
option that behaves like:
"If destination does not exist and copying more than one file, assumes
that destination must be FILES."

I occasionally copy groups of files renaming them as I go. For
example:
xcopy *.html *.ht
I need to do this, because I have some utilities that only understand
8.3 filenames. This sets off xcopy's file/directory query.

I have kludged something by creating a file containing "f" and
attaching it to stdin:
xcopy ...shortf.dat
but this is a kludge and would likely cause trouble if there were a
different prompt.

Ideally, this should work in Windows XP (which as some of you
know, I still use).

Sincerely,

Gene Wirchenko

  #5  
Old August 7th 12, 05:46 AM posted to alt.windows7.general
Gene Wirchenko
external usenet poster
 
Posts: 426
Default xcopy Option?

On Mon, 06 Aug 2012 19:44:38 -0500, Bob I wrote:

Have you tried

xcopy *.html ..\*.htm


I want the two versions in the same directory.

[snip]

Sincerely,

Gene Wirchenko
  #6  
Old August 7th 12, 10:59 AM posted to alt.windows7.general
Roger Mills[_2_]
external usenet poster
 
Posts: 332
Default xcopy Option?

On 07/08/2012 05:46, Gene Wirchenko wrote:
On Mon, 06 Aug 2012 19:44:38 -0500, Bob wrote:

Have you tried

xcopy *.html ..\*.htm


I want the two versions in the same directory.

[snip]

Sincerely,

Gene Wirchenko


That's not a problem - just omit the backslash!
--
Cheers,
Roger
____________
Please reply to Newsgroup. Whilst email address is valid, it is seldom
checked.
  #7  
Old August 7th 12, 05:19 PM posted to alt.windows7.general
Gene Wirchenko
external usenet poster
 
Posts: 426
Default xcopy Option?

On Tue, 07 Aug 2012 10:59:09 +0100, Roger Mills
wrote:

On 07/08/2012 05:46, Gene Wirchenko wrote:
On Mon, 06 Aug 2012 19:44:38 -0500, Bob wrote:

Have you tried

xcopy *.html ..\*.htm


I want the two versions in the same directory.


That's not a problem - just omit the backslash!


That does not work. It replaces the first two characters of the
filename with two periods.

But that got me thinking. I tried
xcopy *.html .\*.htm
and that worked. I assume that xcopy does something a bit different
with bare filenames (i.e., those without a path specified).

Sincerely,

Gene Wirchenko
  #8  
Old August 7th 12, 06:52 PM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default xcopy Option?

On Tue, 07 Aug 2012 10:59:09 +0100, Roger Mills wrote:

On 07/08/2012 05:46, Gene Wirchenko wrote:
On Mon, 06 Aug 2012 19:44:38 -0500, Bob wrote:

Have you tried

xcopy *.html ..\*.htm


I want the two versions in the same directory.

[snip]

Sincerely,

Gene Wirchenko


That's not a problem - just omit the backslash!


No - omit one of the two leading dots.

xcopy *.html .\*.htm

--
Gene E. Bloch (Stumbling Bloch)
  #9  
Old August 7th 12, 07:05 PM posted to alt.windows7.general
Roger Mills[_2_]
external usenet poster
 
Posts: 332
Default xcopy Option?

On 07/08/2012 17:19, Gene Wirchenko wrote:
On Tue, 07 Aug 2012 10:59:09 +0100, Roger
wrote:

On 07/08/2012 05:46, Gene Wirchenko wrote:
On Mon, 06 Aug 2012 19:44:38 -0500, Bob wrote:

Have you tried

xcopy *.html ..\*.htm

I want the two versions in the same directory.


That's not a problem - just omit the backslash!


That does not work. It replaces the first two characters of the
filename with two periods.

But that got me thinking. I tried
xcopy *.html .\*.htm
and that worked. I assume that xcopy does something a bit different
with bare filenames (i.e., those without a path specified).

Sincerely,

Gene Wirchenko


Sorry, I should have said omit the two dots and the backslash. I
actually carried out an experiment to verify it.

I created two files, gash1.htm and gash2.htm
Then I typed xcopy *.htm *.html

Then I typed DIR, and it displayed 4 files - gash1.htm, gash1.html,
gash2.htm and gash2.html
--
Cheers,
Roger
____________
Please reply to Newsgroup. Whilst email address is valid, it is seldom
checked.
  #10  
Old August 7th 12, 10:36 PM posted to alt.windows7.general
Gene Wirchenko
external usenet poster
 
Posts: 426
Default xcopy Option?

On Tue, 07 Aug 2012 19:05:37 +0100, Roger Mills
wrote:

[snip]

Sorry, I should have said omit the two dots and the backslash. I
actually carried out an experiment to verify it.

I created two files, gash1.htm and gash2.htm
Then I typed xcopy *.htm *.html


I am going the other way, .html to .htm.

Sometimes, I get the file/directory message.

Then I typed DIR, and it displayed 4 files - gash1.htm, gash1.html,
gash2.htm and gash2.html


Sorry. Part of my issue is that I want to delete the .htm files
first so that if I delete a .html, its .htm is gone. Windows will
delete my .html files when I do
del *.htm
I dislike this "helpfulness".

Sincerely,

Gene Wirchenko
  #11  
Old August 7th 12, 11:46 PM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default xcopy Option?

On Tue, 07 Aug 2012 14:36:04 -0700, Gene Wirchenko wrote:

On Tue, 07 Aug 2012 19:05:37 +0100, Roger Mills
wrote:

[snip]

Sorry, I should have said omit the two dots and the backslash. I
actually carried out an experiment to verify it.

I created two files, gash1.htm and gash2.htm
Then I typed xcopy *.htm *.html


I am going the other way, .html to .htm.

Sometimes, I get the file/directory message.

Then I typed DIR, and it displayed 4 files - gash1.htm, gash1.html,
gash2.htm and gash2.html


Sorry. Part of my issue is that I want to delete the .htm files
first so that if I delete a .html, its .htm is gone. Windows will
delete my .html files when I do
del *.htm
I dislike this "helpfulness".

Sincerely,

Gene Wirchenko


Use a loop in a batch file.

--
Gene E. Bloch (Stumbling Bloch)
  #12  
Old August 8th 12, 12:05 AM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default xcopy Option?

On Tue, 7 Aug 2012 15:46:55 -0700, Gene E. Bloch wrote:

On Tue, 07 Aug 2012 14:36:04 -0700, Gene Wirchenko wrote:

On Tue, 07 Aug 2012 19:05:37 +0100, Roger Mills
wrote:

[snip]

Sorry, I should have said omit the two dots and the backslash. I
actually carried out an experiment to verify it.

I created two files, gash1.htm and gash2.htm
Then I typed xcopy *.htm *.html


I am going the other way, .html to .htm.

Sometimes, I get the file/directory message.

Then I typed DIR, and it displayed 4 files - gash1.htm, gash1.html,
gash2.htm and gash2.html


Sorry. Part of my issue is that I want to delete the .htm files
first so that if I delete a .html, its .htm is gone. Windows will
delete my .html files when I do
del *.htm
I dislike this "helpfulness".

Sincerely,

Gene Wirchenko


Use a loop in a batch file.


Actually, don't. It acts the same as your command, but one file at a
time.

--
Gene E. Bloch (Stumbling Bloch)
  #13  
Old August 8th 12, 01:39 AM posted to alt.windows7.general
Char Jackson
external usenet poster
 
Posts: 10,449
Default xcopy Option?

On Tue, 07 Aug 2012 14:36:04 -0700, Gene Wirchenko
wrote:

On Tue, 07 Aug 2012 19:05:37 +0100, Roger Mills
wrote:

[snip]

Sorry, I should have said omit the two dots and the backslash. I
actually carried out an experiment to verify it.

I created two files, gash1.htm and gash2.htm
Then I typed xcopy *.htm *.html


I am going the other way, .html to .htm.

Sometimes, I get the file/directory message.

Then I typed DIR, and it displayed 4 files - gash1.htm, gash1.html,
gash2.htm and gash2.html


Sorry. Part of my issue is that I want to delete the .htm files
first so that if I delete a .html, its .htm is gone. Windows will
delete my .html files when I do
del *.htm
I dislike this "helpfulness".


Are you required to use .htm and .html, or can you use other
extensions that would make it easier to differentiate one set of files
from another? Such as .htm and .htm.bak or simply .bak?

--

Char Jackson
  #14  
Old August 8th 12, 01:51 AM posted to alt.windows7.general
Bob I
external usenet poster
 
Posts: 9,943
Default xcopy Option?



On 8/7/2012 4:36 PM, Gene Wirchenko wrote:
On Tue, 07 Aug 2012 19:05:37 +0100, Roger
wrote:

[snip]

Sorry, I should have said omit the two dots and the backslash. I
actually carried out an experiment to verify it.

I created two files, gash1.htm and gash2.htm
Then I typed xcopy *.htm *.html


I am going the other way, .html to .htm.

Sometimes, I get the file/directory message.

Then I typed DIR, and it displayed 4 files - gash1.htm, gash1.html,
gash2.htm and gash2.html


Sorry. Part of my issue is that I want to delete the .htm files
first so that if I delete a .html, its .htm is gone. Windows will
delete my .html files when I do
del *.htm
I dislike this "helpfulness".


Sorry, was backward on the . vs ..

What you say you want to do in deleting files sounds rather confusing.
  #15  
Old August 8th 12, 02:01 AM posted to alt.windows7.general
Nil[_2_]
external usenet poster
 
Posts: 2,170
Default xcopy Option?

On 07 Aug 2012, Gene Wirchenko wrote in
alt.windows7.general:

Sorry. Part of my issue is that I want to delete the .htm files
first so that if I delete a .html, its .htm is gone. Windows will
delete my .html files when I do
del *.htm
I dislike this "helpfulness".


I never knew that the built in DEL command behaved that way. That's not
good.

I use JPSoft's CMD replacement, TCC LE
(http://jpsoft.com/tccle-cmd-replacement.html) and it behaves in a more
sane way. You might consider it. The free version has been good enough
for me.
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 08:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.