Asked By
Kinlyana
310 points
N/A
Posted on - 05/17/2011
Hi there,
I am still in learning process of Dos and I am having an issue while preparing/creating a batch file. The issue I have is that I have developed a batch file, which has got the capability to find lots of file and can copy them into a specific patch/folder.
Whenever, I provide the input as a month in question it goes to find all file except .docx files. Mean my created batch file finds everything else a .docx file.
To solve this issue I tried confirming that this is not so much old dos file (because may be old dos files cannot see the four figure extensions) but it’s not an old one. I also have tried xcopy command but it has not worked too. This problem is very much frustrating and irritating for me because it seems to be a reason of abolishing my lot of effort and time, which I have spent on creating particular batch file.
Now, I am here to find someone who can guide me towards the solution of this issue.
So, I am willing to know How to get rid of a batch file issue?
I’ll really appreciate the help a lot.
Thanks
How to get rid of a batch file issue?
Ah, DOS Batch files, brings back tons of memories. Anyway, this will most probably just be short as you have not even included in your post the exact batch file that you have created so that I will be able to at least check the coding and command if they are correct. Since it has come to this, then I will most likely have to provide you with most of the possible answers.
-
In your batch file, did you indicate a certain length for the file extension? And did you use the asterisk sign or put in a wild card question mark (?) for looking for files? If you have provided the wild card, then please change it to the asterisk (*).
-
What Operating System are you using when you run the batch file? As sometimes, each OS has different ways of doing things in DOS. With that, regarding the issue with the XCOPY, I am assuming that you used the syntax /D:date for copying files from a certain date. If so, then did you for some reason indicate a file name to be copied, if not then try using this as the file name – *.*.Â
-
Whenever you do any kind of file copying, especially if it is done in bulk then it is advisable to set the file name of the file to be copied to *.*, as such you are instructing DOS to copy all files. Since DOS by default only recognizes certain files with a pre-determined character length for the file name, if you did not indicate a file name DOS searches for files by the default programming, meaning all files that have 3 digit extensions. By providing the file name to be copied as *.*, it instructs DOS to look or copy all files regardless of the number of characters in the file name and regardless of the number of characters in the extension.
To provided you with a more exact solution to your problem, you might want to attach a copy of the batch file that you created for me to evaluate it and check to see what you got wrong.
Answered By
brixton
0 points
N/A
#99217
How to get rid of a batch file issue?
Is that a DOS batch file? If so, maybe the old DOS batch file system can't see extensions with four letters. Just a guess. You do know that a .docx file is just a container that has several different file types with different extensions within?Â
Can't you save your word files as a .doc file. Do you really need the capability of .docx files? (When encrypted, they are more secure and that is the only reason I use them occasionally, otherwise I always save as .doc)Â and always check that file name carefuly. Maybe they put a letter O for the number 0.