Welcome!

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

SignUp Now!

Done SETDOS suggestions

Charles Dye

Super Moderator
May
5,331
161
Staff member
Yeah, I know. But these should reduce support requests:

1. Doc change: Document that SETDOS /C /E and /P accept numeric character values, as well as literal characters. This syntax is less confusing because (a) it eliminates the need to escape characters with %= — I know how you love %= — and (b) avoids confusion with batch file encodings and code pages. Hex digits are the same in all encodings, at least until TCC supports EBCDIC batch files.

2. Code tweak: SETDOS /C /E /P should not permit the command separator/escape char/parameter char to be set to the percent sign, double quotes, or backquote — just as redirection characters, whitespace, comma, etc. are already forbidden.
 
I really, really, really, (really) don't want anyone using those options anymore. They were intended to ease the migration from 4DOS / COMMAND batch files to 4NT / CMD. As in 30 years ago ...

They vastly complicate the parser, create way too many incompatibilities (aka bogus "bug reports"), and provide nothing useful. At all.

I added a note to the help file for those three options to explicitly say they are obsolete, deprecated, and not recommended.
 
Systems aren’t always in control of the filenames they must work with.

setdos is 100% necessary to deal with the filenames that people encounter in the real world, particularly if the command separator is in the filename, the percent sign, or a semicolon.

It also seems to be very necessary if you use BAT files to generate other BAT files that use redirection, so you just want to echo the literal string "Echo %VARNAME% >file" to a file. Yea, we can enclose in ``backticks, but i’ve hit situations where the backticks get passed and am superstitious about it now.
 
Back
Top