Post by Kevin ProvanceBwahahahaha.
Back in day I modified the DOS 6.2 setup script to display some not so
friendly messages during install. One co-worked got so upset by it that
he left early for fear that he had actually done what was being displayed
(when in reality it was just installing DOS) and was fearing he was going
to get in some kind of trouble. <eg>
I miss those days.
19 years ago ($Deity I'm old!) I wrote a little joke program called UUDOS
(User-Unfriendly DOS). If anyone is actually wanting the full source for
this program, e-mail me. De-mung my e-mail addy with the clue: My last
initial is "H"
' UUDOS.BAS - User un-friendly disk operating system
' Version 1.00 04/16/86
' Version 1.01 08/16/88 - Changes for QuickBASIC 3.0+,
' improvements on CD/CHDIR command.
' Version 1.10 09/03/90 - Add Sound Blaster Speech Support.
' Version 1.11 09/06/90 - Add DOS 3.30 commands.
' Version 1.12 12/15/90 - BC 7.x and PDQ changes,
' PDQ enabled DOS PROMPT to use ANSI sequences.
' Compile copy sb.bi speech.bi (Sound Blaster) or
' Instructions: copy nosb.bi speech.bi (No Sound Blaster)
' bc /o uudos; (All versions)
'
' link /e uudos,,nul,qbsbc; (No PDQ & Sound Blaster)
or
' link /e uudos; (No PDQ & No Sound
Blaster) or
' link /nod/e uudos acrtused,,nul,basic7 pdq qbsbc; (PDQ & Sound Blaster) or
' link /nod/e uudos,,nul,basic7 pdq; (PDQ & no Sound Blaster)
' Released to the PUBLIC DOMAIN for non-profit distribution
' (C) Copyright 1986, 1990 by William D. Hileman
' Old Address Snipped
' And I ain't putting in my new one here!
' Nor my phone number
' and Knowledge Applied Technologies, Inc.
' (Which went belly-up about a decade ago)
' (And I don't miss it a bit)
' Main Program
DEFINT A-Z
DECLARE FUNCTION PDQValI (Num$) ' rem-out if no PDQ
DECLARE FUNCTION PDQRand (Num) ' rem-out if no PDQ
DECLARE FUNCTION PDQExist (FileSpec$) ' rem-out if no PDQ
' $INCLUDE: 'SPEECH.BI'
DEF FNStrp$ (Txt$) = LTRIM$(RTRIM$(Txt$))
GOSUB Initialize
IF DOSCommand$ <> "" THEN
GOSUB PerformCommandEntry
END IF
DO
GOSUB GetCommandEntry
GOSUB PerformCommandEntry
LOOP UNTIL Done
END
' ***********
Initialize:
' ***********
DOSCommand$ = COMMAND$
' BackSpace$ = CHR$(29) ' non-PDQ version
BackSpace$ = CHR$(8) ' PDQ version
DOSPrompt$ = ENVIRON$("PROMPT") ' retrieve PROMPT setting from DOS
environment
IF DOSPrompt$ = "" THEN
DOSPrompt$ = "$N$G" ' default prompt 'd>'
ELSE
DOSPrompt$ = UCASE$(DOSPrompt$) ' convert to uppercase to make checks
easier
END IF
CurPth$ = CURDIR$ ' read current drive and path
CurDrv$ = LEFT$(CurPth$, 1) ' drive is left-most byte
CrCh = FREEFILE
OPEN "CR.TMP" FOR OUTPUT AS CrCh ' a carriage return for I/O redirection
below
PRINT #CrCh, ""
CLOSE CrCh
SHELL "DATE < CR.TMP > DATE.TMP"
KILL "CR.TMP" ' remove CR.TMP
DateCh = FREEFILE
OPEN "DATE.TMP" FOR INPUT AS DateCh
LINE INPUT #DateCh, date.data$ ' an easy method to determine day of week
CLOSE DateCh
KILL "DATE.TMP" ' remove DATE.TMP
DPos = INSTR(date.data$, "is")
CurDay$ = MID$(date.data$, DPos + 3, 3)
DOSVer$ = "User Un-friendly DOS Version 1.12 12/15/90"
Copyrt$ = "(C) Copyright 1986, 1990 William D. Hileman & K.A.T., Inc."
CopyrtSay$ = "Copyright 1986, 1990 William D. Hi elman and K A T
Incorporated"
NoHlp = 11
DIM Hlp$(NoHlp), HlpS$(NoHlp)
Hlp$(1) = "APPEND ASSIGN ATTRIB BACKUP BASIC BASICA
BREAK"
Hlp$(2) = "CALL CD CHCP CHDIR CHKDSK CLS
COMMAND"
Hlp$(3) = "COMP COPY CTTY DATE DEBUG DEL
DIR"
Hlp$(4) = "DISKCOMP DISKCOPY ECHO EDLIN ERASE ERRORLEVEL
EXE2BIN"
Hlp$(5) = "EXIST FASTOPEN FDISK FIND FOR FORMAT
GOTO"
Hlp$(6) = "GRAFTABL GRAPHICS GWBASIC HELP IF JOIN
KEYB"
Hlp$(7) = "LABEL MD MKDIR MODE MORE NLSFUNC
PATH"
Hlp$(8) = "PAUSE PRINT PROMPT RD RECOVER REM
REN"
Hlp$(9) = "RENAME REPLACE RESTORE RMDIR SAY SELECT
SET"
Hlp$(10) = "SHARE SHIFT SORT SPEECH SUBST SYS
TIME"
Hlp$(11) = "TREE TYPE VER VERIFY VOL XCOPY"
HlpS$(1) = "APPEND, ASSIGN, ATTRIB, BACKUP, BASIC, BASIC AY, BREAK"
HlpS$(2) = "CALL, C D, C H C P, CHANGE DIRECTORY, CHECK DISK, C L S,
COMMAND"
HlpS$(3) = "COMPARE, COPY, C T T Y, DATE, DEE BUG, DELETE, DIRECTORY"
HlpS$(4) = "DISK COMPARE, DISK COPY, ECKO, ED LIN, E RASE, ERROR LEVEL, E X
E 2 BIN"
HlpS$(5) = "EXIST, FAST OPEN, F DISK, FIND, FOR, FOR MAT, GO TO"
HlpS$(6) = "GRAF TABLE, GRAPHICS, G W BASIC, HELP, IF, JOIN, KEY BOARD"
HlpS$(7) = "LABEL, M D, MAKE DIRECTORY, MODE, MORE, NULLS FUNK, PATH"
HlpS$(8) = "PAUSE, PRINT, PROMPT, R D, RECOVER, REM, REN"
HlpS$(9) = "RENAME, REPLACE, RESTORE, REMOVE DIRECTORY, SAY, SELECT, SET"
HlpS$(10) = "SHARE, SHIFT, SORT, SPEECH, SUBSTITUTE, SIS, TIME"
HlpS$(11) = "TREE, TYPE, VERSION, VERIFY, VOLUME, X COPY"
RETURN
' *****************
GetCommandEntry:
' ****************
GOSUB DisplayDOSPrompt
LINE INPUT DOSCommand$ ' that's really all DOS does . . .
RETURN
' *****************
DisplayDOSPrompt:
' *****************
PromptCopy$ = DOSPrompt$
WHILE PromptCopy$ <> ""
CPos = INSTR(PromptCopy$, "$") ' prompt command character indicator
IF CPos = 0 THEN
PRINT PromptCopy$;
PromptCopy$ = ""
ELSE
PRINT LEFT$(PromptCopy$, CPos - 1);
IF CPos = LEN(PromptCopy$) THEN
PRINT "$";
PromptCopy$ = ""
ELSE
PCmd$ = MID$(PromptCopy$, CPos + 1, 1)
PromptCopy$ = MID$(PromptCopy$, CPos + 2)
IF PCmd$ = "$" THEN
PRINT "$";
ELSEIF PCmd$ = "T" THEN
GOSUB DisplayTime
ELSEIF PCmd$ = "D" THEN
GOSUB DisplayDate
ELSEIF PCmd$ = "P" THEN
PRINT CurPth$;
ELSEIF PCmd$ = "V" THEN
PRINT DOSVer$;
ELSEIF PCmd$ = "N" THEN
PRINT CurDrv$;
ELSEIF PCmd$ = "G" THEN
PRINT ">";
ELSEIF PCmd$ = "L" THEN
PRINT "<";
ELSEIF PCmd$ = "B" THEN
PRINT "|";
ELSEIF PCmd$ = "Q" THEN
PRINT "=";
ELSEIF PCmd$ = "H" THEN
PRINT BackSpace$; " "; BackSpace$;
ELSEIF PCmd$ = "E" THEN
PRINT CHR$(27);
ELSEIF PCmd$ = "_" THEN
PRINT
END IF
END IF
END IF
WEND
RETURN
' ************
DisplayTime:
' ************
PTime$ = TIME$
IF LEFT$(PTime$, 1) = "0" THEN
MID$(PTime$, 1, 1) = " "
END IF
PRINT PTime$; ".";
' PRINT RIGHT$("00" + LTRIM$(STR$(INT(RND(1) * 99) + 1)), 2); ' non-PDQ
version random 100ths seconds
PRINT RIGHT$("00" + LTRIM$(STR$(PDQRand(99))), 2); ' PDQ version random
100ths seconds
RETURN
' ************
DisplayDate:
' ************
PDate$ = DATE$
IF LEFT$(PDate$, 1) = "0" THEN
MID$(PDate$, 1, 1) = " "
END IF
PRINT CurDay$; " "; PDate$;
RETURN
' ********************
PerformCommandEntry:
' ********************
DOSCommand$ = UCASE$(FNStrp$(DOSCommand$))
IF DOSCommand$ = "!" THEN
Done = -1
ELSEIF LEN(DOSCommand$) = 2 AND LEFT$(DOSCommand$, 1) >= "A" AND
LEFT$(DOSCommand$, 1) <= "Z" AND RIGHT$(DOSCommand$, 1) = ":" THEN
CHDRIVE DOSCommand$
IF LEFT$(CURDIR$, 2) = CurDrv$ THEN
PrntSay "Invalid drive specification"
PRINT
ELSE
CurDrv$ = DOSCommand$
CurPth$ = CURDIR$
END IF
ELSEIF LEFT$(DOSCommand$, 6) = "APPEND" THEN
PRINT
PrntSay "Which APPENDage did you have in mind?"
PRINT
ELSEIF LEFT$(DOSCommand$, 6) = "ASSIGN" THEN
PRINT
PRINT "Sorry, I don't do homework ASSIGNments - I'm a BUSINESS computer!"
Say "Sorry, I don't do home work assignments - I'm a BUSINESS computer"
PRINT
ELSEIF LEFT$(DOSCommand$, 6) = "ATTRIB" THEN
PRINT
PRINT "I ATTRIBute the malfunctions to the HARDWARE!"
Say "I attribute the mal functions to the HARDWARE"
PRINT
ELSEIF LEFT$(DOSCommand$, 6) = "BACKUP" THEN
PRINT
PrntSay "BACKUP WHAT? I can't find ANYTHING!"
PRINT
ELSEIF LEFT$(DOSCommand$, 6) = "BASICA" THEN
PRINT
PrntSay "Now you're talkin' my language!"
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "BASIC" THEN
PRINT
PrntSay "Why not use the more Advanced version!"
PRINT
ELSEIF DOSCommand$ = "BREAK" THEN
PRINT
PrntSay "Don't look at me - I didn't BREAK it!"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "CALL" THEN
PRINT
PrntSay "I'm sorry. That number has been dis-connected,"
PrntSay "or is temporarily out of service. Please CALL"
PrntSay "your operator for assistance."
PRINT
ELSEIF DOSCommand$ = "CD" OR LEFT$(DOSCommand$, 3) = "CD " OR
LEFT$(DOSCommand$, 5) = "CHDIR" THEN
GOSUB ChangeDirectory
ELSEIF LEFT$(DOSCommand$, 4) = "CHCP" THEN
PRINT
PRINT "Now you'll really get us lost!"
Say "Now you'll really get us lost"
PRINT
ELSEIF DOSCommand$ = "CHKDSK" THEN
PRINT
PRINT "The disk checks-out okay!"
Say "The disk checks-out O K"
PRINT
ELSEIF DOSCommand$ = "CLS" THEN
CLS
ELSEIF LEFT$(DOSCommand$, 7) = "COMMAND" THEN
PRINT
PRINT "Hey, do it yourself - I'm not your slave!"
Say "Hay, do it yourself - I'm not your slave"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "COMP" THEN
PRINT
PrntSay "Sorry, I don't do COMPositions."
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "COPY" THEN
PRINT "Sorry, that would be in violation of copyright laws!"
Say "Sorry, that would be in violation of copyright laws"
PRINT " 0 File(s) copied"
Say "0 Files copeed"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "CTTY" THEN
PRINT
PrntSay "Don't go changin' - to try and please me . . ."
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "DATE" THEN
PRINT
PRINT "What time shall I pick you up, honey?"
Say "What time shall I pick you up, honey"
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "DEBUG" THEN
PRINT
PRINT "Where's DE BUG!"
Say "Wheere's de bug"
PRINT
ELSEIF LEFT$(DOSCommand$, 3) = "DEL" OR LEFT$(DOSCommand$, 5) = "ERASE" THEN
PRINT
PrntSay "They were already gone."
PRINT
ELSEIF LEFT$(DOSCommand$, 3) = "DIR" THEN
GOSUB Directory
ELSEIF LEFT$(DOSCommand$, 8) = "DISKCOMP" THEN
PRINT
PrntSay "All diskettes look alike to me."
PRINT
ELSEIF LEFT$(DOSCommand$, 8) = "DISKCOPY" THEN
PRINT
PrntSay "Try using a XEROX for once - I'm tired!"
PRINT
ELSEIF FNStrp$(DOSCommand$) = "ECHO" THEN
PRINT
PRINT "Echo"
Say "ecko"
PRINT " Echo"
Say "ecko"
PRINT " Echo"
Say "ecko"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "ECHO" THEN
Echo$ = FNStrp$(MID$(DOSCommand$, 5))
ELen = LEN(Echo$) + 1
PRINT
FOR Cnt = 1 TO 3
PRINT Echo$
Say FNStrp$(Echo$)
Echo$ = SPACE$(ELen) + Echo$
NEXT Cnt
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "EDLIN" THEN
PRINT
PrntSay "Ed's not here - neither is Lynn."
PRINT
ELSEIF LEFT$(DOSCommand$, 10) = "ERRORLEVEL" THEN
PRINT
PRINT "I calculate the errorlevel at billions and billions."
Say "I cal culate the error level at billions and billions."
PRINT
ELSEIF LEFT$(DOSCommand$, 7) = "EXE2BIN" THEN
PRINT
PRINT "Poof! The invisible EXE file is now an invisible COM file!"
Say "Poof! The invisible E X E file is now an invisible COM file"
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "EXIST" THEN
PRINT
PRINT "Of course it exists - are you blind?"
Say "Of course it exists - are you blind"
PRINT
ELSEIF LEFT$(DOSCommand$, 8) = "FASTOPEN" THEN
PRINT
PRINT "Pick, pick, pick - I'm opening as fast as I can!"
Say "Pick, pick, pick, I'm opening as fast as I can!"
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "FDISK" THEN
PRINT
PrntSay "Don't you think the disk is screwed-up enough already?"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "FIND" THEN
PRINT
PrntSay "I looked EVERYWHERE - I can't find it!"
PRINT
ELSEIF DOSCommand$ = "FOR" OR LEFT$(DOSCommand$, 4) = "FOR " THEN
PRINT
PrntSay "I'm neither FOR nor against that."
PRINT
ELSEIF LEFT$(DOSCommand$, 6) = "FORMAT" THEN
PRINT
PRINT "Not tonight, I've got a headache!"
Say "Not tonight, I've got a headache"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "GOTO" THEN
PRINT
PrntSay "Already been there, no big deal."
PRINT
ELSEIF LEFT$(DOSCommand$, 8) = "GRAFTABL" THEN
PRINT
PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
PRINT "º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º"
PRINT "º º º º"
PRINT "º º º º"
PRINT "º º º º"
PRINT "ÈÍŒ ÈÍŒ"
PrntSay "Graphics Table"
PRINT
ELSEIF LEFT$(DOSCommand$, 8) = "GRAPHICS" THEN
PRINT
PRINT "ÉÍËÍ»"
PRINT "ÌÍÎ͹"
PRINT "ÈÍÊÍŒ"
PrntSay "Graphics Window"
PRINT
ELSEIF LEFT$(DOSCommand$, 7) = "GWBASIC" THEN
PRINT
PRINT "Gee Wiz! Ballistic Arming Systems In Chaos!"
Say "Gee Wiz! Ballistic Arming Systems In kayoss!"
PRINT
ELSEIF DOSCommand$ = "HELP" THEN
PRINT
FOR Cnt = 1 TO NoHlp
PRINT Hlp$(Cnt)
Say HlpS$(Cnt)
NEXT Cnt
PRINT
ELSEIF LEFT$(DOSCommand$, 2) = "IF" THEN
PRINT
PrntSay "And if my grandmother had wheels, she'd be a wagon."
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "JOIN" THEN
PRINT
PRINT "No thanks, I already belong to too many organizations!"
Say "No thanks, I already belong to too many organizations"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "KEYB" THEN
PRINT
PrntSay "Sorry, I only speak ENGLISH."
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "LABEL" THEN
PRINT
PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
PRINT "º ";
Sprs = -1
PrntSay "UNION LABEL"
PRINT " º"
PRINT "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍŒ"
PRINT
ELSEIF LEFT$(DOSCommand$, 3) = "MD " OR LEFT$(DOSCommand$, 5) = "MKDIR" THEN
PRINT
PRINT "Sorry, I just ran out of all the necessary ingrediants!"
Say "Sorry, I just ran out of all the necessary ingreediants!"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "MODE" THEN
PRINT
PrntSay "Sorry, we're stuck in UUDOS mode."
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "MORE" THEN
PRINT
PrntSay "Forget it! I think you've had too many to drive already!"
PRINT
ELSEIF LEFT$(DOSCommand$, 7) = "NLSFUNC" THEN
PRINT
PRINT "Get down, get NLSFUNCky!"
Say "Get down, get NULSFUNCky"
PRINT
ELSEIF DOSCommand$ = "PATH" THEN
PRINT
PrntSay "PATH=THE YELLOW BRICK ROAD"
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "PAUSE" THEN
PRINT
PrntSay "Pardon me while I take a pause for the cause..."
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "PRINT" THEN
PRINT
PRINT "Sorry, the printer's asleep, and I ain't gonna wake him!"
Say "Sorry, the printer's asleep, and I ain't gonna wake him"
PRINT
ELSEIF LEFT$(DOSCommand$, 6) = "PROMPT" THEN
GOSUB NewPrompt
ELSEIF LEFT$(DOSCommand$, 3) = "RD " OR LEFT$(DOSCommand$, 5) = "RMDIR" THEN
PRINT
PRINT "NO WAY! That's my summer home!"
Say "NO WAY. That's my summer home"
PRINT
ELSEIF LEFT$(DOSCommand$, 7) = "RECOVER" THEN
PRINT
PrntSay "It's too late for that, don't you think?"
PRINT
ELSEIF LEFT$(DOSCommand$, 3) = "REM" THEN
PRINT
PrntSay "REMarkable, isn't it?"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "REN " OR LEFT$(DOSCommand$, 6) = "RENAME"
THEN
PRINT
PRINT "Don't confuse me! I just got done memorizing all the names!"
Say "Don't confuse me. I just got done memorizing all the names"
PRINT
ELSEIF LEFT$(DOSCommand$, 7) = "REPLACE" THEN
PRINT
PRINT "What are you doing, Dave?"
Say "What are you doing, Dave"
PRINT
ELSEIF LEFT$(DOSCommand$, 7) = "RESTORE" THEN
PRINT
PrntSay "Leave me alone - I'm happy just the way I am!"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "SAY " THEN
PRINT
PrntSay FNStrp$(MID$(DOSCommand$, 5))
PRINT
ELSEIF LEFT$(DOSCommand$, 6) = "SELECT" THEN
PRINT
PrntSay "I don't see it on the menu."
PRINT
ELSEIF DOSCommand$ = "SET" THEN
Env = 1
WHILE ENVIRON$(Env) <> ""
PrntSay ENVIRON$(Env)
Env = Env + 1
WEND
PRINT
ELSEIF LEFT$(DOSCommand$, 3) = "SET" THEN
PRINT
PRINT "Okay, now what?"
Say "O K, now what"
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "SHARE" THEN
PRINT
PRINT "NO! MINE! MINE! MINE! - and you can't have any!"
Say "NO! MINE! MINE! MINE! - and you can't have any"
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "SHIFT" THEN
PRINT
PRINT "I work the graveyard shift, how about you?"
Say "I work the grave yard shift, how about you"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "SORT" THEN
PRINT
PrntSay "Why? It's already in UUDOS order."
PRINT
ELSEIF DOSCommand$ = "SPEECH" THEN
IF Sb THEN
IF Talk THEN
PrntSay "SPEECH is on"
ELSE
PRINT "SPEECH is off"
END IF
ELSE
PRINT "Sound Blaster driver not installed."
END IF
ELSEIF DOSCommand$ = "SPEECH ON" THEN
Talk = -1
ELSEIF DOSCommand$ = "SPEECH OFF" THEN
Talk = 0
ELSEIF LEFT$(DOSCommand$, 5) = "SUBST" THEN
PRINT
PrntSay "Forget it, there's no SUBSTitute for PERFECTION."
PRINT
ELSEIF LEFT$(DOSCommand$, 3) = "SYS" THEN
PRINT
PrntSay "Your request for transfer has been denied."
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "TIME" THEN
PRINT
PrntSay "Current time is: Same time as it was yesterday at this time."
PRINT
ELSEIF DOSCommand$ = "TREE" THEN
PRINT
PRINT " oOOOOOo"
PRINT " OOOOOOOOO"
PRINT " OOOOOOOOO"
PRINT " oOOOOOo"
PRINT " | |"
PRINT " | |"
PRINT " | |"
PRINT " / \"
PRINT
PrntSay "Binary Tree"
PRINT
ELSEIF LEFT$(DOSCommand$, 4) = "TYPE" AND LEN(DOSCommand$) > 5 THEN
PRINT
PRINT "Okay, here goes:"
Say "O K, here goes:"
PRINT
FOR Cnt = 6 TO LEN(DOSCommand$)
Sprs = -1
PrntSay MID$(DOSCommand$, cnt, 1)
' Timr = VAL(RIGHT$(TIME$, 2)) ' non-PDQ version
Timr = PDQValI(RIGHT$(TIME$, 2)) ' PDQ version
' WHILE VAL(RIGHT$(TIME$, 2)) = Timr ' non-PDQ version
WHILE PDQValI(RIGHT$(TIME$, 2)) = Timr ' PDQ version
WEND
NEXT Cnt
Say MID$(DOSCommand$, 6)
PRINT
PRINT
ELSEIF DOSCommand$ = "VER" THEN
PRINT
PrntSay DOSVer$
PRINT Copyrt$
Say CopyrtSay$
PRINT
ELSEIF DOSCommand$ = "VERIFY" THEN
PRINT
PRINT "Looks okay to me!"
Say "Looks o k to me"
PRINT
ELSEIF LEFT$(DOSCommand$, 3) = "VOL" THEN
PRINT
PrntSay "I was in the service - I don't VOLunteer to do anything."
PRINT
ELSEIF LEFT$(DOSCommand$, 5) = "XCOPY" THEN
PRINT
PRINT "How many X's do you want me to copy, and why?"
Say "How many eckses do you want me to copy, and why"
PRINT
ELSEIF DOSCommand$ <> "" THEN
PrntSay "Bad command or file name"
PRINT
END IF
RETURN
' **********
NewPrompt:
' **********
DOSPrompt$ = MID$(DOSCommand$, 7)
WHILE LEFT$(DOSPrompt$, 1) = " "
DOSPrompt$ = MID$(DOSPrompt$, 2)
WEND
IF DOSPrompt$ = "" THEN
DOSPrompt$ = "$N$G"
END IF
ENVIRON "PROMPT=" + DOSPrompt$
RETURN
' **********
Directory:
' **********
NotFound = -1
UDir = 0
GPos = INSTR(DOSCommand$, ">")
IF GPos THEN
DOSCommand$ = LEFT$(DOSCommand$, GPos - 1)
END IF
PPos = INSTR(DOSCommand$, "/P")
IF PPos THEN
DOSCommand$ = LEFT$(DOSCommand$, PPos - 1) + MID$(DOSCommand$, PPos + 2)
END IF
Wide = (INSTR(DOSCommand$, "/W") <> 0)
DIRCommand$ = DOSCommand$ + " > UUDOS.DIR"
SHELL DIRCommand$
DirCh = FREEILE
OPEN "UUDOS.DIR" FOR INPUT AS DirCh
WHILE NOT EOF(DirCh)
LINE INPUT #DirCh, DirLine$
IF INSTR(DirLine$, "UUDOS DIR") <> 0 THEN
UDir = -1
END IF
IF INSTR(DirLine$, "UUDOS DIR") = 0 OR Wide THEN
FPos = INSTR(DirLine$, "File(s)")
IF FPos = 0 THEN
PrntSay DirLine$
ELSE
IF Wide OR NOT UDir THEN
PrntSay DirLine$
NotFound = 0
ELSE
' FilCnt = VAL(LEFT$(DirLine$, 9)) + UDir ' non-PDQ version
FilCnt = PDQValI(LEFT$(DirLine$, 9)) + UDir ' PDQ version
IF FilCnt > 0 THEN
PrntSay RIGHT$(SPACE$(8) + STR$(FilCnt), 8) + " " + MID$(DirLine$,
FPos)
NotFound = 0
END IF
END IF
END IF
END IF
WEND
IF NotFound THEN
PrntSay "File not found"
END IF
PRINT
CLOSE DirCh
KILL "UUDOS.DIR"
RETURN
' ****************
ChangeDirectory:
' ****************
IF LEFT$(DOSCommand$, 2) = "CD" THEN
NewDir$ = FNStrp$(MID$(DOSCommand$, 3))
ELSE
NewDir$ = FNStrp$(MID$(DOSCommand$, 6))
END IF
IF LEN(NewDir$) = 2 AND RIGHT$(NewDir$, 1) = ":" AND LEFT$(NewDir$, 1) >=
"A" AND LEFT$(NewDir$, 1) <= "Z" THEN
AltDir$ = CURDIR$(NewDir$)
IF AltDir$ = "" THEN
PrntSay "Invalid drive specification"
ELSE
PrntSay AltDir$
END IF
PRINT
ELSEIF NewDir$ = "" THEN
PrntSay CurPth$
PRINT
ELSE
IF LEN(NewDir$) > 1 AND MID$(NewDir$, 2, 1) = ":" AND LEFT$(NewDir$, 1) >=
"A" AND LEFT$(NewDir$, 1) <= "Z" AND LEFT$(NewDir$, 2) <> CurDrv$ THEN
ChkDir$ = CURDIR$(LEFT$(NewDir$, 2))
IF ChkDir$ = "" THEN
PrntSay "Invalid drive specification"
PRINT
ELSE
IF NOT PDQExist(NewDir$ + "\NUL") THEN ' rem-out if no PDQ
PrntSay "Invalid directory" ' rem-out if no PDQ
PRINT ' rem-out if no PDQ
ELSE ' rem-out if no PDQ
CHDIR NewDir$
END IF ' rem-out if no PDQ
END IF
ELSE
IF NOT PDQExist(NewDir$ + "\NUL") THEN ' rem-out if no PDQ
PrntSay "Invalid directory" ' rem-out if no PDQ
PRINT ' rem-out if no PDQ
ELSE ' rem-out if no PDQ
CHDIR NewDir$
CurPth$ = CURDIR$
END IF ' rem-out if no PDQ
END IF
END IF
RETURN