Live data from Hacker News

Shhh: The Undocumented DOS Commands (1999)

the-eye.eu

31–40 of 57 posts

Re: Shhh: The Undocumented DOS Commands (1999)

#31
post #3

>Last updated on Friday, January 1, 1999. This is a walk down memory lane, but not in a good way. I'm very, very glad to no longer have to remember anything about config.sys.

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 people who didn't know how to do things like switch directories, print a list of files in the current directory, etc. My parents never knew they were doing me a favor by buying a computer that ran Windows 3.1 so poorly that I needed to do everything in DOS.

Re: Shhh: The Undocumented DOS Commands (1999)

#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 by the way. Bookmarked!

Re: Shhh: The Undocumented DOS Commands (1999)

#33
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…

ECHO %BLASTER%

You almost had it, you just need two percents.

It is the same syntax as Windows cmd.exe currently uses

Re: Shhh: The Undocumented DOS Commands (1999)

#34
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.

Re: Shhh: The Undocumented DOS Commands (1999)

#35
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 is just putting a LOADHIGH in CONFIG.SYS instead of in AUTOEXEC.BAT)

Re: Shhh: The Undocumented DOS Commands (1999)

#36

I remember learning about "FDISK /mbr" from a DEC support tech support line. I rescued several hard disks with that command that other people had deemed "broken".

That command saved me at least a dozen of times while playing too much with my partition table and the dual boot configuration with Linux. (Partition) Magic :-)

I really miss the simplicity of MBR-based partitioning, still need to wrap my head around UEFI and GPT

Re: Shhh: The Undocumented DOS Commands (1999)

#37

I remember feeling angry when I learned about the undocumented MBR switch for FDISK. There I was, beginning to learn to spell words with 6 or more letters, thinking I had to use a hex editor to clean up the MBR. All that effort with no guidance whatsoever that could have been minimized with one extra line of documentation.

Weird, FDISK /MBR was actually the only command I knew about.

Re: Shhh: The Undocumented DOS Commands (1999)

#38

Dos4 still had commands to control a tape deck

GW-BASIC (which was included prior to DOS 5.x) had the MOTOR command to control the cassette motor. I don't know if it actually worked though. In Microsoft's released GW-BASIC 1.0 source, it is a no-op and just prints an error message – https://github.com/microsoft/GW-BASIC/blob/master/GIOCAS.ASM [EDIT: I just disassembled GWBASIC.EXE version 3.23, I can see the calls to the BIOS INT 15h cassette API, so it isn't just a no-op in the binary.]

If it worked at all, it would have worked by calling INT 15h functions 0-1, which was part of the BIOS cassette API. I believe in ROM BASIC on the original IBM PC and PCjr, the MOTOR command was actually implemented to call those BIOS routines, and the BIOS actually had code to talk to the cassette port. I think, on subsequent machines, the BIOS routines were stubbed out and just returned an error.

GW-BASIC was the only part of MS-DOS which had any reference to the cassette tape. The more core parts of MS-DOS (IO.SYS, MSDOS.SYS, COMMAND.COM) knew absolutely nothing about it.

Re: Shhh: The Undocumented DOS Commands (1999)

#39

I remember learning about "FDISK /mbr" from a DEC support tech support line. I rescued several hard disks with that command that other people had deemed "broken".

That command saved me at least a dozen of times while playing too much with my partition table and the dual boot configuration with Linux. (Partition) Magic :-) I really miss the simplicity of MBR-based partitioning, still need to wrap my head around UEFI and GPT

UEFI is actually a lot simpler than MBR-type partitioning as far as the user is concerned. The UEFI firmware partition is based on a FAT-like fs, hence it natively supports dual- and multi-booting and can provide a "Shell" that's quite comparable to DOS itself. There are ongoing problems with UEFI due to shoddy OEM implementations, but the basic idea is quite sensible.

Re: Shhh: The Undocumented DOS Commands (1999)

#40
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…

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...
Post reply on HN