- Nov
- 339
- 7
I use a lot the FOR command in the TCC command line to process sets of files (to check on them, move them around, etc.). A quickly typed command does well and good... until a filename containing spaces shows up, which produces wonky results. For example:
Sometimes, it's an unexpected result (as above), sometimes is a "file not found" error per offending file, et cetera. Yes, it's a simple matter of placing quotes around each occurence of the variable name ("%A", in the example above) to avoid the problem, and yet... the user can forget to add them.
I think it'd be quite convenient to add a /Q option to the FOR command, where its presence indicates that each occurrence of the variable is to be enclosed in quotes. In my example, the command would internally become:
for %a in (201*) echo %@cksum["%A"] "%a"
and processed as such.
Sometimes, it's an unexpected result (as above), sometimes is a "file not found" error per offending file, et cetera. Yes, it's a simple matter of placing quotes around each occurence of the variable name ("%A", in the example above) to avoid the problem, and yet... the user can forget to add them.
I think it'd be quite convenient to add a /Q option to the FOR command, where its presence indicates that each occurrence of the variable is to be enclosed in quotes. In my example, the command would internally become:
for %a in (201*) echo %@cksum["%A"] "%a"
and processed as such.