Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Is there a way to get around this limitation of file names?

May
855
0
I long ago learned not to place commas in the names of files and directories I create because (as far as I can tell) TCC has a very hard time dealing with file and directory names with commas in them in batch files. However, I have one particular directory ("C, C++") whose name predates my first installation of 4NT/Take Command/TCC many years ago and that I absolutely do not want to go into the "hassle" of changing because it is embedded in far too many (literally hundreds over 20 years) places to change at this point. So the question is simple: Is there some way I can get TCC batch files to ignore commas in the contents of variables? I've looked at the "SetDOS" command many times in the past (including just now before making this posting), and all I see are comments to the effect that you "can't use commas".
 
A possible work-around could be to create a junction point to the problematic directory and use that in your TCC scripts/aliases while still keeping the old name for backwards compatibility.
 
A possible work-around could be to create a junction point to the problematic directory and use that in your TCC scripts/aliases while still keeping the old name for backwards compatibility.
Thank you, but I have, in fact, tried that, but I can't make said batch files not see said directory and therefore not "try" to "deal with" it (again, even trying to put that name into the contents of a variable causes a real problem), and since that directory exists any "process" that "scans" the directory tree putting the names of the encountered directories into a variable array encounters problems.
 
Thank you, but I have, in fact, tried that, but I can't make said batch files not see said directory and therefore not "try" to "deal with" it (again, even trying to put that name into the contents of a variable causes a real problem), and since that directory exists any "process" that "scans" the directory tree putting the names of the encountered directories into a variable array encounters problems.

It the directory appearing in directory listings is a problem, then maybe hiding it by setting the HIDDEN and/or SYSTEM attribute could help.

Assuming your scripts do not always list also those kind of files/directories.
 
If it is in code, btm, or text files, then a good search and replace tool would seem the way to go.
Dave, it is not that you are wrong (because you are not). It is more a case of trying to remember what all I've changed and what all I haven't and what all I still need to change and what all I don't is something that, as usual given my bad memory (which is no longer even slightly humorous; I've probably said this before, but without my computer and my cell phone (both of which might be called "external" memory) I would have to be institutionalized) is simply beyond my capabilities. (I will add that a very high percentage of this stuff is "archived" in .7z (like .zip but better compression) files that I only look at to update or maybe "steal" code from the programs that they contain.) Looks like I'm "stuck" with things the way they are...
 
It the directory appearing in directory listings is a problem, then maybe hiding it by setting the HIDDEN and/or SYSTEM attribute could help.

Assuming your scripts do not always list also those kind of files/directories.
Nik, maybe I am wrong because it was a long time ago (and my memory ain't so good), but I think I tried that (and made a "directory" whose name did not have that problem and symbolically "linked" it to the old, "bad" directory) and it just plain "broke" too many things. However, since I don't remember for sure I will try it again! Thank you!
 
I long ago learned not to place commas in the names of files and directories I create because (as far as I can tell) TCC has a very hard time dealing with file and directory names with commas in them in batch files. However, I have one particular directory ("C, C++") whose name predates my first installation of 4NT/Take Command/TCC many years ago and that I absolutely do not want to go into the "hassle" of changing because it is embedded in far too many (literally hundreds over 20 years) places to change at this point. So the question is simple: Is there some way I can get TCC batch files to ignore commas in the contents of variables? I've looked at the "SetDOS" command many times in the past (including just now before making this posting), and all I see are comments to the effect that you "can't use commas".

What problem are you having? I don't know of any issue with filenames containing commas. You just need to quote them -- the same as if they contained spaces.
 
What problem are you having? I don't know of any issue with filenames containing commas. You just need to quote them -- the same as if they contained spaces.
Charles, to put it simply, I no longer remember. (My often-mentioned bad-memory is not a joke or an exaggeration; it is becoming an increasingly "crippling" element of of my life.) And the situation came up in the last day or two in a one-time-only use batch file that I created, ran, deleted, and no longer have. The best I can do is to try to remember the situation and save the exact code that caused the problem in the future when and if I re-post this problem. Sorry about that...
 
Originally Posted by nikbackmIt the directory appearing in directory listings is a problem, then maybe hiding it by setting the HIDDEN and/or SYSTEM attribute could help.

Nik, maybe I am wrong because it was a long time ago (and my memory ain't so good), but I think I tried that (and made a "directory" whose name did not have that problem and symbolically "linked" it to the old, "bad" directory) and it just plain "broke" too many things (the "Hidden" and "System" attributes did not work ("System" directories are also "automatically" hidden, which I didn't even know). However, since I don't remember for sure I will try it again! Thank you!
Nik, that did, in fact, "break" some things (including me in the sense that the directory no longer "showed up" where I expected it to which, particularly because of my bad memory, confused the heck out of me), but thank you for at least putting me on the right track!!! Setting the "Archive" attribute on the directory (I was a little bit surprised to find that directories evidently never get their "Archive" attributes set "naturally") and doing "For /A:-A" gets the job done perfectly! Again, thank you for making me "think" about it and putting me on the right track!!!
 
What problem are you having? I don't know of any issue with filenames containing commas. You just need to quote them -- the same as if they contained spaces.
Charles, I no longer remember the exact details (I'll try to remember to not to keep bringing up my bad memory (if I remember to! ; > ) >), but the problem almost certainly showed up when the directory name in an "@Index" function (putting the directory name in quotes effectively causes the "@Index" function to not work at all), but another person in this thread (Nik) put me on the right track: setting the "Archive" attribute on the directory and doing "For /A:-A" gets the job done perfectly!
 
Nik, that did, in fact, "break" some things (including me in the sense that the directory no longer "showed up" where I expected it to which, particularly because of my bad memory, confused the heck out of me), but thank you for at least putting me on the right track!!! Setting the "Archive" attribute on the directory (I was a little bit surprised to find that directories evidently never get their "Archive" attributes set "naturally") and doing "For /A:-A" gets the job done perfectly! Again, thank you for making me "think" about it and putting me on the right track!!!

Good to hear.

Nice trick with the archive attribute, seems a little similar to how Microsoft originally implemented long filenames on FAT filesystems.

http://home.teleport.com/~brainy/lfn.htm
 

Similar threads

Back
Top