|
Answer» Too many YEARS - too much forgotten. My batch file which use MD to create directories from a list of new folders have stopped working for some reason. It used to be that the command line
MD "This Folder Has A LONG Name"
made a folder with that name. Now, I get six folders named "This", "Folder", "Has", "A", "Long" and "Name". Been searching for the simple "Duh" answer for days. Does someone remember out there?
Spending Hours to save minutes. and haven't found a real reference yet. Running XP Pro SP3 on 4 year old AMD64 box w/2 gig RAM.
I know this must have an easy answer, and it would be much appreciated. Code: [SELECT]S:\Test\longname>md "This folder has a very long name indeed"
S:\Test\longname>dir Volume in drive S is USBHD Volume Serial Number is 2C51-AA7F
Directory of S:\Test\longname
05/05/2010 06:43 PM <DIR> . 05/05/2010 06:43 PM <DIR> .. 05/05/2010 06:43 PM <DIR> This folder has a very long name indeed 0 File(s) 0 bytes 3 Dir(s) 197,617,135,616 bytes free
S:\Test\longname>
Post your batch file. Thank's much for your post. In copying and testing my original batch file, it created unusual characters in the filename which were not in the batch text, so I noted it was saved in UTF-8. When changed it to ANSI, it was less weird, but still made a directory for each noncontiguous word after MD". When the command is typed in the dos window, all is fine, but when in the batch file, is not fine.
The non-working batch looks thus: G: CD.. CD G:\Audio\_Raw downloads MD "1006 281 1202-1206" CD "1006 281 1202-1206" MD “1 filenr1 (Speaker1 name here)” MD “2 filenr2 (Speaker2 name here)” MD “3 filenr3 (Speaker3 name here)” MD “4 filenr4 (Speaker4 name here)” MD “5 filenr5 (Speaker5 name here)” MD “6 filenr6 (Speaker6 name here)” PAUSE It is not the spaces that are causing your problem - you are using the wrong kind of QUOTES.
You are using these quotes
“ ”
You need to use ordinary double quotes like this
" "
see this code which works
Code: [Select]MD "1 filenr1 (Speaker1 name here)" MD "2 filenr2 (Speaker2 name here)" MD "3 filenr3 (Speaker3 name here)" MD "4 filenr4 (Speaker4 name here)" MD "5 filenr5 (Speaker5 name here)" MD "6 filenr6 (Speaker6 name here)" I am ecstatic! Thanks for the solution! As I expected, it was something dumb.
in Notepad, I changed the display font to "system" from Tahoma and it confirmed the problem in quotes characters which then displayed as vertical bars. The original text is copied from an Excel Spreadsheet which looks at paste from a web page and using text handling equations, creates the batch text. An unconscious change of font created the whole thing.
It is done!
Mahalo from Honolulu. I strongly suggest that when you are creating or editing code that you use a monospaced font such as Courier New, Lucida Cosole or Consolas. These fonts are much better for consoles and code editors. It will be heeded. Again, many thanks for your commitment and ongoing contributions to many others.
|