You're very lucky. I still had my old
DS.BTM script (a cut down and modernized version of a
SYSINF.BAT that I picked up many years ago) on one machine, from which this is an excerpt. This requires JP Software's 4DOS, which is now freeware. As you can see, it picks up the
LASTDISK value from DOS, and explicitly avoids removable and network drives.
do d = %@ascii[A] to %@ascii[%_lastdisk]
iff %@ready[%@char[%d]:] EQ 1 then
iff %@removable[%@char[%d]:] NE 1 .AND. %@remote[%@char[%d]:] NE 1 then
dir /s /a: %@char[%d]:\
The people who have mistaken DOS for Windows in other answers will be pleased to know that this 4DOS script — taken from a twenty year old
SYSINF.BAT script for 4DOS which I updated to newer versions of 4DOS and then ported to 4OS2 — still works, just the same as on 4DOS, with JP Software's TCC/LE on Windows NT 6.1.