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 | Rating: | Display Modes |
#1
|
|||
|
|||
XCOPY Prompt
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 |
Ads |
#2
|
|||
|
|||
XCOPY Prompt
"Gene Wirchenko" wrote in message ... 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? -- Bill Gateway M465e ('06 era) - Windows Live Mail 2009 Centrino Core2 Duo T7400 2.16 GHz - 1.5GB - Windows 8 CP |
#3
|
|||
|
|||
XCOPY Prompt
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 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? -- “There is no worse tyranny than to force a man to pay for what he does not want merely because you think it would be good for him.” ? Robert A. Heinlein |
#4
|
|||
|
|||
XCOPY Prompt
On Mon, 23 Apr 2012 14:18:15 -0700, 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 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. -- Steve Hayes from Tshwane, South Africa Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk |
#5
|
|||
|
|||
XCOPY Prompt
On 4/23/12 3: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 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 |
#6
|
|||
|
|||
XCOPY Prompt
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 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. -- “There is no worse tyranny than to force a man to pay for what he does not want merely because you think it would be good for him.” ? Robert A. Heinlein |
#7
|
|||
|
|||
XCOPY Prompt
On Tue, 24 Apr 2012 07:23:24 -0700, Bob Hatch
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 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. 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 |
#8
|
|||
|
|||
XCOPY Prompt
On Mon, 23 Apr 2012 16:05:28 -0700, Bob Hatch
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. Sincerely, Gene Wirchenko |
#9
|
|||
|
|||
XCOPY Prompt
On Tue, 24 Apr 2012 07:58:57 -0700, Tecknomage
wrote: On Tue, 24 Apr 2012 07:23:24 -0700, Bob Hatch wrote: 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. Sincerely, Gene Wirchenko |
#10
|
|||
|
|||
XCOPY Prompt
On 4/24/2012 9:56 AM, Gene Wirchenko wrote:
On Tue, 24 Apr 2012 07:58:57 -0700, Tecknomage wrote: On Tue, 24 Apr 2012 07:23:24 -0700, Bob wrote: 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. Sincerely, Gene Wirchenko -- “There is no worse tyranny than to force a man to pay for what he does not want merely because you think it would be good for him.” ? Robert A. Heinlein |
#11
|
|||
|
|||
XCOPY Prompt
On Tue, 24 Apr 2012 11:41:32 -0700, "Bob Hatch"
wrote in article 4f96f3dd$0$2326$c3e8da3$38634283 @news.astraweb.com... On 4/24/2012 9:56 AM, Gene Wirchenko wrote: On Tue, 24 Apr 2012 07:58:57 -0700, Tecknomage wrote: On Tue, 24 Apr 2012 07:23:24 -0700, Bob wrote: 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. -- Zaphod "The best Bang since the Big One" - Eccentrica Gallumbits |
#12
|
|||
|
|||
XCOPY Prompt
On 4/24/2012 7:58 AM, Tecknomage wrote:
On Tue, 24 Apr 2012 07:23:24 -0700, Bob 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 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. 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. 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. -- “There is no worse tyranny than to force a man to pay for what he does not want merely because you think it would be good for him.” ? Robert A. Heinlein |
#13
|
|||
|
|||
XCOPY Prompt
On Mon, 23 Apr 2012 14:18:15 -0700, 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 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 -- Char Jackson |
#14
|
|||
|
|||
XCOPY Prompt
On Tue, 24 Apr 2012 12:59:33 -0700, Bob Hatch
wrote: On 4/24/2012 7:58 AM, Tecknomage wrote: On Tue, 24 Apr 2012 07:23:24 -0700, Bob 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 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. 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. 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. -- Char Jackson |
#15
|
|||
|
|||
XCOPY Prompt
On 24/04/2012 17:51, Gene Wirchenko wrote:
On Mon, 23 Apr 2012 16:05:28 -0700, Bob 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*. -- choro Sincerely, Gene Wirchenko |
Thread Tools | |
Display Modes | Rate This Thread |
|
|