home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
01e
/
let12.zip
/
DEMO-3.BAT
< prev
next >
Wrap
DOS Batch File
|
1987-09-17
|
2KB
|
53 lines
echo Off
If `%Name%' == `' Demo
cls
echo ╔════════════════════════════════════════════════════════════════╗
echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
echo │ ║ DOS Information: DATELINE, FILESPEC, READ ║ │
echo └─╫────────────────────────────────────────────────────────────────╫─┘
echo ╚════════════════════════════════════════════════════════════════╝
echo
echo LET also allows DOS to have access, directly or indirectly, to
echo a wealth of information. A few examples are, the date and time,
echo the current drive and directory or the directory of any given
echo drive, and the volume label on any given drive. Here: I'll show
echo you.
echo
LET Date=(DateLine)
LET Dir=(filespec "dp")
echo Today's date (if the system clock is set) is %date%,
echo and the current drive and path is %Dir%
set Date=
set dir=
echo
LET NumDrives=(upper (mid (ask (concat Name ", what is the letter of highest drive you have? ")) 1 1))
set Drive=@
echo Ok, %Name%, now be sure to have the drive doors closed on all
echo your floppy drives; I'll wait while you do that.
pause
echo
echo Drive Volume name Current Directory
echo ----- -------------- ----------------------
:DriveTop
if %Drive% == %NumDrives% goto DriveEnd
LET Drive=(char (plus 1 (ascii Drive)))
vol %Drive%: > Volume.$$$
LET Dummy=(Do "Drives")
if `%Check%' == `' goto DriveBad
if not `%Check%' == `has' LET Vol=(substr Vol 4)
LET Vol=(fill (dup "≥" 16) Vol " ")
echo %Drive%: %Vol% \%DrivePath%
goto DriveTop
:DriveBad
echo Um, %Name%, I have to take issue with what you told me, because
echo I can't find a drive %Drive%:
:DriveEnd
set Drive=
set NumDrives=
set DrivePath=
set Check=
set Vol=
erase Volume.$$$
pause
DEMO-4