Live data from Hacker News

Shhh: The Undocumented DOS Commands (1999)

the-eye.eu

41–50 of 57 posts

Re: Shhh: The Undocumented DOS Commands (1999)

#41
post #40

Earlier quoted context omitted.

ECHO %BLASTER% You almost had it, you just need two percents. It is the same syntax as Windows cmd.exe currently uses

OK, so I tried this, but ECHO %PATH% just outputs %PATH%. I'm running DOS 6.22 on a 286. Same thing happens for any other variable defined in AUTOEXEC...

"In DOS I believe that %var% expansion only works in batch files, not at the command line directly."[1] That worked for me in an emulator.[2]

[1] https://stackoverflow.com/questions/28021862/echo-variable-s...

[2] https://jamesfriend.com.au/pce-js/ibmpc-games/

Re: Shhh: The Undocumented DOS Commands (1999)

#42

So 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…

DOS wasn't a very big program. Anyone with some time on their hands could go through the assembly dumps. And there were a lot of curious people with time on their hands.

Re: Shhh: The Undocumented DOS Commands (1999)

#43
post #32

I have been revisiting the DOS eco-system lately and I have run into a problem. I can't remember how to ECHO a variable set in AUTOEXEC.BAT. E.g, to ECHO the BLASTER variable, I've tried ECHO BLASTER, ECHO $BLASTER, ECHO $BLASTER$, ECHO %BLASTER, etc.. But nothing. Somehow a Google search didn't turn up anything. I'm starting to wonder if it was it even possible to do this and that my memory is incorrect? Cool list b…

It was % to indicate environment variables. echo %PATH% Should work, as long as that variable is in scope, which it should be on an old MSDOS platform with a single thread.

Environmental variables have scopes?

Re: Shhh: The Undocumented DOS Commands (1999)

#44
post #23

Never 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…

> Never realized INSTALLHIGH and LH were not documented. I recall using these, so I always assumed they were commonly known. LH is documented in the MS-DOS 6.22 online help. "HELP LH" brings it up. (The full name of the command is LOADHIGH, but LH is an acceptable abbreviation. The online help documents the LH abbreviation.) (INSTALLHIGH by contrast wasn't documented... but LOADHIGH and DEVICEHIGH were. INSTALLHIGH i…

> INSTALLHIGH is just putting a LOADHIGH in CONFIG.SYS instead of in AUTOEXEC.BAT

Yeah, and if anybody wonders what the point of this was: starting with DOS 6 you could have different boot profiles (menu items) in CONFIG.SYS. For example, depending on the program to run you'd want to have either extended memory (XMS via HIMEM.SYS), or expanded memory (EMS via EMM386.EXE) available.

INSTALL[HIGH]= allowed running different TSRs (roughly, background programs) for each profile from the same place (although in practice it was still common to have GOTO %CONFIG% in AUTOEXEC.BAT). Typical TSRs would include something like MSCDEX.EXE for CD-ROM support, SMARTDRV.EXE (disk cache), and a hardware-specific mouse driver (typically *MOUSE.COM).

If you had too many TSRs running at once there would be not enough base memory (the first 640 KiB) left, and some programs would refuse to start.

Writing this makes me realize we've really gone a long way.

Re: Shhh: The Undocumented DOS Commands (1999)

#46
post #41
post #40

Earlier quoted context omitted.

OK, so I tried this, but ECHO %PATH% just outputs %PATH%. I'm running DOS 6.22 on a 286. Same thing happens for any other variable defined in AUTOEXEC...

"In DOS I believe that %var% expansion only works in batch files, not at the command line directly."[1] That worked for me in an emulator.[2] [1] https://stackoverflow.com/questions/28021862/echo-variable-s... [2] https://jamesfriend.com.au/pce-js/ibmpc-games/

Confirmed. It doesn't work directly from the prompt, only within a batch file. I think might work on a DOS 7 prompt (Win95 >) though, not sure, I don't have a Windows machine hooked up atm. Maybe that's where my memory is from...

Thanks!

Re: Shhh: The Undocumented DOS Commands (1999)

#47

Earlier quoted context omitted.

It was % to indicate environment variables. echo %PATH% Should work, as long as that variable is in scope, which it should be on an old MSDOS platform with a single thread.

Environmental variables have scopes?

Its probably that variables defined in AUTOEXEC are "global" scope, i.e. can be referenced in any other batch file, but variables defined within a batch file other than AUTOEXEC only exist within the scope (context) of that batch file. But, I haven't tested this...

Re: Shhh: The Undocumented DOS Commands (1999)

#48

So 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…

When DOS was a big deal, it was both a big enough deal and a small enough program to be fully dissected, disassembled, studied, documented, patched, outright reimplemented, etc. It's probably harder to find some technical detail about DOS that outsiders didn't figure out.

Re: Shhh: The Undocumented DOS Commands (1999)

#49

Earlier quoted context omitted.

It was % to indicate environment variables. echo %PATH% Should work, as long as that variable is in scope, which it should be on an old MSDOS platform with a single thread.

Environmental variables have scopes?

I think in DOS they were all global in scope. SETLOCAL appeared with Windows NT (cmd.exe), not sure which version (I didn't use the early ones).

Re: Shhh: The Undocumented DOS Commands (1999)

#50
post #31

Earlier quoted context omitted.

But I bet you do, including how to create it on a system with no editor.

I don't actually remember much about config.sys, despite spending much of my formative years editing it in the attempt to claw back as much of that 640k as possible. But I do remember "copy con filename.txt", which I'm hoping is the answer to the second part of your question. I actually had to walk a coworker through some Windows and Linux and it was a bit stunning to realize that there are now highly technical peopl…

That was exactly what I was thinking of, though the rest of what I remember about config.sys revolves around battles with emm386. Ah, for the simplicity of the 286.

It's weird hos DOS perversity made it super-easy to pick up unix when Linux became available, but I've retained a loathing of unnecessarily short commands like 'cp' 'mv' and especially 'man', probably in proportion to the difficulty of guessing them.

Post reply on HN