All that effort with no guidance whatsoever that could have been minimized with one extra line of documentation.
Shhh: The Undocumented DOS Commands (1999)
21–30 of 57 posts
Re: Shhh: The Undocumented DOS Commands (1999)
#22I guess we'll probably never see this updated to include that, though!
Re: Shhh: The Undocumented DOS Commands (1999)
#23And :: for comments is just a creative trick based on how labels in batch files are parsed. It wasn't originally supposed to be used this way, so no wonder the documentation never mentioned it.
The difficulty in writing batch scripts was always that the best (or sometimes only) way of doing many things was to use a command originally intended for something completely different, in a completely non-intuitive way, and examples for such usage were never part of any official documentation. For example:
To display an empty line (instead of "ECHO is on"):
ECHO.
To create a file:
COPY CON FILE.TXT
Even now, the way to load the output of a command into a variable is to use FOR:
FOR /F %T IN ('TIME /T') DO SET TIME=%T
And the best way to empty a directory of all its contents is to use ROBOCOPY /MIR.
Re: Shhh: The Undocumented DOS Commands (1999)
#24Re: Shhh: The Undocumented DOS Commands (1999)
#25Dos4 still had commands to control a tape deck
As do many cloud instances. I'm not sure about other distributions, but Debian and Ubuntu ship `mt` with their cpio packages.
Re: Shhh: The Undocumented DOS Commands (1999)
#26So how were these found? Today I guess I'd try running strings on the executable or maybe straight-up opening them in a debugger or disassembler (I assume command-line argument parsing is a very obvious, easy-ish to read block of code right at the start of the program), but I'm not sure how much of that was available (or at widely accessible, at least) back when DOS was a big deal (this list talks about DOS 2.x, whic…
Example usage for some of them could be discovered by going through the contents of .BAT files written by Microsoft, especially those that were a part of MS-DOS (and later Windows 9x) Setup (installer).
All the built-in commands appeared in plain text in COMMAND.COM, as did all the CONFIG.SYS parameters in IO.SYS. As far as I know there wasn't a UN*X-like strings(1) utility at the time but binary files could still be browsed with third-party tools.
Re: Shhh: The Undocumented DOS Commands (1999)
#27Re: Shhh: The Undocumented DOS Commands (1999)
#28So how were these found? Today I guess I'd try running strings on the executable or maybe straight-up opening them in a debugger or disassembler (I assume command-line argument parsing is a very obvious, easy-ish to read block of code right at the start of the program), but I'm not sure how much of that was available (or at widely accessible, at least) back when DOS was a big deal (this list talks about DOS 2.x, whic…
Why today? I spent a fair amount of time during my childhood reading through "command.com" in a binary editor (zap-it), mostly for changing error messages to impress girls. It didn't really work, but I learned quite a lot in the process.
Re: Shhh: The Undocumented DOS Commands (1999)
#29Re: Shhh: The Undocumented DOS Commands (1999)
#30Never realized INSTALLHIGH and LH were not documented. I recall using these, so I always assumed they were commonly known. And :: for comments is just a creative trick based on how labels in batch files are parsed. It wasn't originally supposed to be used this way, so no wonder the documentation never mentioned it. The difficulty in writing batch scripts was always that the best (or sometimes only) way of doing many…