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

May 24, 2010
855
0
Northlake, Il
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".
 
May 30, 2008
235
2
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.
 
May 24, 2010
855
0
Northlake, Il
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.
 
May 30, 2008
235
2
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.
 
May 24, 2010
855
0
Northlake, Il
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...
 
May 24, 2010
855
0
Northlake, Il
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!
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
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.
 
May 24, 2010
855
0
Northlake, Il
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...
 
May 24, 2010
855
0
Northlake, Il
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!!!
 
May 24, 2010
855
0
Northlake, Il
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!
 
May 30, 2008
235
2
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
Thread starter Title Forum Replies Date
M Is there any way to work around this (apparent) limitation of TCC? Support 59
Dick Johnson for ... do loop "wrap around" Support 11
Jay Sage Brackets Around Variable Names Support 11
M How to? Work around an unexpected and very inconvenient behavior of TCC... Support 26
M What can I do to "word around" this problem? Support 8
M A (minor) limitation of @FileSize... Support 6
A Limitation regarding creation of shortcut keys for "copy" Support 0
M An undocumented limitation and an associated minor bug... Support 1
S 10.0.55 - @FILEARRAY limitation Support 4
J History file load hangs if file has complete garbage in it... Support 1
jdanielp Cannot step into and/or call another .bat file when debugging .bat file Support 2
thorntonpg file explorer - short cut keys Support 1
JohnQSmith New online help file wrong logo Support 7
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
samintz How to? swap endianness in a binary file Support 12
vefatica `Back quotes` - command line vs. batch file Support 5
fpefpe How to? batch file size Support 2
Jay Sage Issues With TCMD File Explorer Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
Joe Caverly @FILESIZE and NTFS File Stream Support 1
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
U Command help on file names Support 5
S Concatenate all playlists into 1 file Support 22
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
Joe Caverly Rename file that begins with Emoji Support 7
Joe Caverly PSHELL and NTFS File Streams Support 2
P Kill all other instances of tcc from a btm batch file Support 2
D ffind hangs on large file Support 18
Alpengreis Documentation Minor issue in help file for view /E Support 1
fpefpe batch file ending early Support 18
J Licesne file location Support 1
K robocopy cancelling batch file processing Support 28
Jay Sage TCMD Crashes with "tctoolbar /c /r file" Support 5
A Unable to pass batch file arguments unaltered Support 18
MikeBaas How to...extract a string from a .json-file? Support 10
vefatica LIBRARY and file name completion? Support 4
D What does the file "..\Everything\Run history.csv" store? Support 5
H Takecommand.pdf failed not a pdf file Support 6
Joe Caverly DIRectory Colorization in v25 Help File Support 0
C show file description? with dir? Support 8
D When copying/moving, appending " (2)" to filename when the target file already exist. Support 7
R How to? Dir specific file search patterns with spaces in the pathnames? Support 6
Joe Caverly _EXPANSION in help file Support 0
Stefan Hassel Installation file TC 24.02 Build 47 is actually version 25.00.1 Support 10
vefatica Are @FILEDATE[file] and @FILEDATE[file,u] ever different? Support 2
K_Meinhard Help file error Support 1
Joe Caverly JOBMONITOR in Help File Support 1
D btm file command line augments comparing for string or math. Support 12
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
vefatica Can TCC complete this file name? Support 5

Similar threads