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. |
|
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
|
|