home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progbas
/
gwbsu102.arj
/
FILE-MAN.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-01-10
|
21KB
|
671 lines
10 'Label START
20 'Set up and print intro screen.
30 '
40 KEY OFF
50 CLS
60 PRINT " The GWBASIC 3.22 File Manager, Version 1
70 PRINT
80 PRINT
90 PRINT " By Matt Roberts
100 PRINT " 3 Cedar St., # 8
110 PRINT " Montpelier, Vt 05602-3006
120 PRINT " (802)223-2553
130 PRINT
140 PRINT
150 PRINT "If you find the files on this disk useful, a donation of $5.00 would
160 PRINT "be greatly appreciated. Thanks.
170 PRINT
180 PRINT
190 PRINT
200 PRINT "If you have trouble running this program, and the documentation doesn't
210 PRINT "seem to help, you can call me between 9AM and 9PM EST, and I'll try to
220 PRINT "help.
230 PRINT
240 PRINT
250 PRINT
260 PRINT
270 'Wait for user to press a key; then continue.
280 GOSUB 6620
290 GOTO 430
300 'Label QUITPROG
310 '
320 'Here is the routine for leaving the program.
330 CLS
340 KEY ON
350 END
360 '
370 'Intro screen is now set up and printed.
380 '
390 '
400 'Now direct the program to create a menu of options.
410 '
420 'Here is the menu of options.
430 'Label MENU
440 CLS
450 ON ERROR GOTO 0
460 PRINT " Your Options
470 PRINT
480 PRINT
490 PRINT "1- List files.
500 PRINT
510 PRINT "2- Work with CONFIG.SYS file.
520 PRINT
530 PRINT "3- Work with the AUTOEXEC.BAT file.
540 PRINT
550 PRINT "4- Delete Files.
560 PRINT
570 PRINT "5- Make Directory.
580 PRINT
590 PRINT "6- Remove Directory."
600 PRINT
610 PRINT "7- Rename Files."
620 PRINT
630 PRINT "8- Display File Contents."
640 PRINT
650 PRINT "9- Quit the Program."
660 PRINT
670 PRINT
680 INPUT "Please press the key corresponding to your choice; then press Enter. ",CHOICE
690 ON CHOICE GOSUB 770,970,2650,3730,4140,4420,5190,5530,300
700 GOTO 430
710 '
720 'This is the end of the menu.
730 '
740 '
750 '
760 'Here is the routine for looking at available files.
770 'Label SEEFILES
780 ON ERROR GOTO 0
790 'Label SEEFLAGN
800 CLS
810 PRINT " View Your Files
820 PRINT
830 PRINT
840 INPUT "Which directory";DIRECTORY$
850 FILES DIRECTORY$
860 'Label SKIP
870 PRINT
880 PRINT
890 INPUT "Would you like to view more files (y/n)";VIEWMORE$
900 IF VIEWMORE$="y" OR VIEWMORE$="Y" THEN 790 ELSE RETURN
910 '
920 'This is the end of the routine for looking at available files.
930 '
940 '
950 '
960 'Here is the routine for working with the CONFIG.SYS file.
970 'Label CHANGECON
980 ON ERROR GOTO 0
990 CLS
1000 PRINT " View or Change Your CONFIG.SYS File
1010 PRINT
1020 PRINT
1030 INPUT "On which drive is your CONFIG.SYS file";DRIVE$
1040 DRIVE$=DRIVE$+"\"
1050 'Label REDRIVE
1060 'Label CONFMENU
1070 CLS
1080 PRINT "You have the following options:
1090 PRINT
1100 PRINT
1110 PRINT "1- Just view the CONFIG.SYS file."
1120 PRINT
1130 PRINT "2- Add lines to the end of your file.
1140 PRINT
1150 PRINT "3- Create a new CONFIG.SYS file."
1160 PRINT
1170 PRINT "4- Return to the options menu.
1180 PRINT
1190 PRINT
1200 PRINT
1210 INPUT "Please press the number corresponding to your choice, and then press Enter. ",CHNGVIEW$
1220 IF CHNGVIEW$="1" THEN GOSUB 2190:GOTO 1060
1230 IF CHNGVIEW$="2" THEN GOSUB 2410:GOSUB 2190:GOTO 1060
1240 IF CHNGVIEW$="3" THEN 1320:GOTO 1060
1250 IF CHNGVIEW$="4" THEN RETURN
1260 GOTO 1060
1270 '
1280 '
1290 '
1300 'This section creates a new CONFIG.SYS file.
1310 '
1320 'Label NEWFILEC
1330 CLS
1340 IF DRIVE$="a:\" THEN FILE1$="a:\config.sys
1350 IF DRIVE$="A:\" THEN FILE1$="A:\CONFIG.SYS
1360 IF DRIVE$="b:\" THEN FILE1$="b:\config.sys
1370 IF DRIVE$="B:\" THEN FILE1$="B:\CONFIG.SYS
1380 IF DRIVE$="c:\" THEN FILE1$="c:\config.sys
1390 IF DRIVE$="C:\" THEN FILE1$="C:\CONFIG.SYS
1400 IF DRIVE$="d:\" THEN FILE1$="d:\config.sys
1410 IF DRIVE$="D:\" THEN FILE1$="D:\CONFIG.SYS
1420 IF DRIVE$="a:\" THEN FILE2$="a:\config.bas
1430 IF DRIVE$="A:\" THEN FILE2$="A:\CONFIG.BAS
1440 IF DRIVE$="b:\" THEN FILE2$="b:\config.bas
1450 IF DRIVE$="B:\" THEN FILE2$="B:\CONFIG.BAS
1460 IF DRIVE$="c:\" THEN FILE2$="c:\config.bas
1470 IF DRIVE$="C:\" THEN FILE2$="C:\CONFIG.BAS
1480 IF DRIVE$="d:\" THEN FILE2$="d:\config.bas
1490 IF DRIVE$="D:\" THEN FILE2$="D:\CONFIG.BAS
1500 NAME FILE1$ AS FILE2$
1510 PRINT
1520 PRINT
1530 PRINT "Your CONFIG.SYS file has been changed to CONFIG.BAS in order to save
1540 PRINT "it for future use. To use it later it will have to be renamed to
1550 PRINT "CONFIG.SYS, after the current CONFIG.SYS has been renamed to
1560 PRINT "something else (for example, CONFIG.X)."
1570 PRINT
1580 PRINT
1590 PRINT
1600 GOSUB 6630
1610 'Label CHANGEAGN
1620 CLS
1630 OPEN FILE1$ FOR OUTPUT AS 1
1640 PRINT "How many files do you want (if you're not sure, type 20)?
1650 INPUT "To quit, press Q and Enter. ",FILENUMB$
1660 IF FILENUMB$="q" OR FILENUMB$="Q" THEN 2050
1670 PRINT# 1, "files=";FILENUMB$
1680 PRINT
1690 PRINT
1700 PRINT
1710 INPUT "How many buffers do you want (if you're not sure, type 5)";BUFFER$
1720 PRINT# 1, "buffers=";BUFFER$
1730 GOSUB 5900
1740 'Label DEVCAGAIN
1750 PRINT
1760 INPUT "Which device would you like to include (N for none)";DEVICE$
1770 IF DEVICE$="n" OR DEVICE$="N" THEN 1820
1780 PRINT# 1, "devices=";DEVICE$
1790 PRINT
1800 INPUT "Would you like to include more devices";INCLDMORE$
1810 IF INCLDMORE$="y" OR INCLDMORE$="Y" THEN 1740
1820 'Label NODEVICE
1830 PRINT
1840 INPUT "Do you want BREAK on or off (if not sure, type OFF)";BREAKYN$
1850 IF BREAKYN$="on" OR BREAKYN$="ON" THEN PRINT# 1, "BREAK=ON"
1860 CLOSE 1
1870 GOSUB 2190
1880 PRINT
1890 PRINT
1900 PRINT
1910 PRINT "If this is not O.K. AND you want to go back and change the file, press C and Enter."
1920 PRINT
1930 PRINT "To restore your original CONFIG.SYS file, press R and Enter."
1940 PRINT
1950 INPUT "If you're happy with it as is, type OK and Enter. ",CHANGE$
1960 'Label OKDECIDE
1970 IF CHANGE$="c" OR CHANGE$="C" THEN 1610
1980 IF CHANGE$="r" OR CHANGE$="R" THEN 2050
1990 IF CHANGE$="ok" OR CHANGE$="OK" THEN 1060
2000 PRINT
2010 INPUT "You must choose between C, R, or OK. ",CHANGE$
2020 GOTO 1960
2030 '
2040 '
2050 'Label RESTOREC
2060 CLS
2070 CLOSE 1
2080 KILL FILE1$
2090 NAME FILE2$ AS FILE1$
2100 PRINT "Your original CONFIG.SYS file has been restored.
2110 GOSUB 6630
2120 GOTO 1060
2130 '
2140 'This is the end of the routine for working with the CONFIG.SYS file.
2150 '
2160 '
2170 '
2180 'Here is the routine for looking at the CONFIG.SYS file.
2190 'Label SEESYS
2200 IF DRIVE$="a:\" THEN FILE$="a:\config.sys"
2210 IF DRIVE$="b:\" THEN FILE$="b:\config.sys"
2220 IF DRIVE$="c:\" THEN FILE$="c:\config.sys"
2230 IF DRIVE$="d:\" THEN FILE$="d:\config.sys"
2240 CLS
2250 PRINT "Here is your file:"
2260 PRINT
2270 OPEN FILE$ FOR INPUT AS 1
2280 WHILE NOT EOF(1)
2290 LINE INPUT#1, A$
2300 PRINT A$
2310 WEND:CLOSE
2320 GOSUB 6630
2330 RETURN
2340 '
2350 'This is the end of the routine for looking at the CONFIG.SYS file.
2360 '
2370 '
2380 '
2390 'Here is the routine for adding lines to the end of CONFIG.SYS
2400 '
2410 'Label APPENDLN
2420 IF DRIVE$="a:\" THEN FILE$="a:\config.sys
2430 IF DRIVE$="A:\" THEN FILE$="a:\config.sys
2440 IF DRIVE$="b:\" THEN FILE$="b:\config.sys
2450 IF DRIVE$="B:\" THEN FILE$="b:\config.sys
2460 IF DRIVE$="c:\" THEN FILE$="c:\config.sys
2470 IF DRIVE$="C:\" THEN FILE$="c:\config.sys
2480 IF DRIVE$="d:\" THEN FILE$="d:\config.sys
2490 IF DRIVE$="D:\" THEN FILE$="d:\config.sys
2500 OPEN FILE$ FOR APPEND AS 1
2510 GOSUB 5900
2520 'Label APPENDAGN
2530 PRINT
2540 INPUT "Line to add (Q to quit)";APPENDLN$
2550 IF APPENDLN$="q" OR APPENDLN$="Q" THEN CLOSE 1:RETURN
2560 PRINT# 1, APPENDLN$
2570 GOTO 2520
2580 '
2590 'This is the end of the routine for adding lines to CONFIG.SYS
2600 '
2610 '
2620 '
2630 'Here is the routine for working with the AUTOEXEC.BAT file.
2640 '
2650 'Label CHNGAUTO
2660 ON ERROR GOTO 0
2670 CLS
2680 PRINT " View or Change Your AUTOEXEC.BAT file.
2690 PRINT
2700 PRINT
2710 INPUT "On which drive is your AUTOEXEC.BAT file";DRIVE$
2720 DRIVE$=DRIVE$+"\"
2730 'Label REDRIVEA
2740 'Label AUTOMENU
2750 CLS
2760 PRINT "You have the following options:"
2770 PRINT
2780 PRINT
2790 PRINT "1- Just view the AUTOEXEC.BAT file."
2800 PRINT
2810 PRINT "2- Add lines to the end of your file."
2820 PRINT
2830 PRINT "3- Create a new AUTOEXEC.BAT file."
2840 PRINT
2850 PRINT "4- Return to the Main Options Menu."
2860 PRINT
2870 PRINT
2880 PRINT
2890 INPUT "Please press the number corresponding to your choice, and then press Enter. ",CHNGAUTO$
2900 IF CHNGAUTO$="1" THEN CLS:GOSUB 6130:GOTO 2740
2910 IF CHNGAUTO$="2" THEN CLS:GOSUB 6410:GOSUB 6130:GOTO 2740
2920 IF CHNGAUTO$="3" THEN CLS:GOTO 3000
2930 IF CHNGAUTO$="4" THEN CLS:RETURN
2940 GOTO 2740
2950 '
2960 '
2970 '
2980 'This routine creates a new AUTOEXEC.BAT file.
2990 '
3000 'Label NEWAUTO
3010 IF DRIVE$="a:\" THEN FILE1$="a:\autoexec.bat
3020 IF DRIVE$="A:\" THEN FILE1$="a:\autoexec.bat
3030 IF DRIVE$="b:\" THEN FILE1$="b:\autoexec.bat
3040 IF DRIVE$="B:\" THEN FILE1$="b:\autoexec.bat
3050 IF DRIVE$="c:\" THEN FILE1$="c:\autoexec.bat
3060 IF DRIVE$="C:\" THEN FILE1$="C:\autoexec.bat
3070 IF DRIVE$="d:\" THEN FILE1$="d:\autoexec.bat
3080 IF DRIVE$="D:\" THEN FILE1$="d:\autoexec.bat
3090 IF DRIVE$="a:\" THEN FILE2$="a:\autoexec.bas
3100 IF DRIVE$="A:\" THEN FILE2$="a:\autoexec.bas
3110 IF DRIVE$="b:\" THEN FILE2$="b:\autoexec.bas
3120 IF DRIVE$="B:\" THEN FILE2$="b:\autoexec.bas
3130 IF DRIVE$="c:\" THEN FILE2$="c:\autoexec.bas
3140 IF DRIVE$="C:\" THEN FILE2$="c:\autoexec.bas
3150 IF DRIVE$="d:\" THEN FILE2$="d:\autoexec.bas
3160 IF DRIVE$="D:\" THEN FILE2$="d:\autoexec.bas
3170 NAME FILE1$ AS FILE2$
3180 CLS
3190 PRINT "Your AUTOEXEC.BAT file has been changed to AUTOEXEC.BAS in order to
3200 PRINT "save it for later use. To use it later, you will have to rename it
3210 PRINT "AUTOEXEC.BAT after renaming the current AUTOEXEC.BAT to something else
3220 PRINT "(for example, AUTOEXEC.X)."
3230 PRINT
3240 PRINT
3250 GOSUB 6630
3260 'Label SCNDCHNG
3270 CLS
3280 OPEN FILE1$ FOR OUTPUT AS 1
3290 PRINT "Please type the first line you want, then press Enter (Q to quit).
3300 PRINT
3310 INPUT "> ",FIRSTLN$
3320 IF FIRSTLN$="q" OR FIRSTLN$="Q" THEN GOTO 3600
3330 PRINT# 1, FIRSTLN$
3340 'Label CONTLINE
3350 PRINT
3360 PRINT "Please type your next line, followed by Enter (Q to quit).
3370 PRINT
3380 INPUT "> ",NEXTLINE$
3390 IF NEXTLINE$="q" OR NEXTLINE$="Q" THEN GOTO 3420
3400 PRINT# 1,NEXTLINE$
3410 GOTO 3340
3420 'Label STOPCHNG
3430 CLOSE # 1
3440 CLS
3450 GOSUB 6130
3460 PRINT
3470 PRINT
3480 PRINT
3490 PRINT "If this is not O.K. AND you want to change it, press C and then Enter.
3500 PRINT
3510 PRINT "To restore your original AUTOEXEC.BAT, press R and then Enter.
3520 PRINT
3530 INPUT "If you're happy with it as is, type OK and Enter. ",CHANGEYN$
3540 'Label RECHANGE
3550 IF CHANGEYN$="c" OR CHANGEYN$="C" THEN GOTO 3260
3560 IF CHANGEYN$="r" OR CHANGEYN$="R" THEN GOTO 3600
3570 IF CHANGEYN$="ok" OR CHANGEYN$="OK" THEN GOTO 2740
3580 PRINT
3590 INPUT "You must choose C, R, or OK. ",CHANGEYN$:GOTO 3540
3600 'Label NOCHANGE
3610 CLS
3620 CLOSE # 1
3630 KILL FILE1$
3640 NAME FILE2$ AS FILE1$
3650 PRINT "Your original AUTOEXEC.BAT file has been restored.":GOSUB 6630:GOTO 2740
3660 '
3670 'This is the end of the routine for working with the AUTOEXEC.BAT file.
3680 '
3690 '
3700 '
3710 ' Here is the routine for deleting files.
3720 '
3730 'LABEL killfile
3740 ON ERROR GOTO 0
3750 CLS
3760 PRINT " Delete Files
3770 PRINT
3780 PRINT
3790 PRINT "Before going any further, you should be aware that, once a file has
3800 PRINT "been deleted, it is very difficult to retrieve it. From this program,
3810 PRINT "it is impossible; there is no undelete option available.
3820 PRINT
3830 'LABEL deletagn
3840 INPUT "Press Enter to continue, or Q and Enter to quit. ",CONTYN$
3850 IF CONTYN$="q" OR CONTYN$="Q" THEN RETURN
3860 CLS
3870 PRINT " Delete Files
3880 PRINT
3890 PRINT
3900 INPUT "File to delete (include drive and path)";FILE$
3910 PRINT
3920 PRINT
3930 PRINT "All the data in "FILE$;" will be destroyed.
3940 PRINT
3950 PRINT
3960 INPUT "Press Enter to continue or Q and Enter to quit. ",CONTYN$
3970 IF CONTYN$="q" OR CONTYN$="Q" THEN RETURN
3980 KILL FILE$
3990 PRINT
4000 PRINT
4010 PRINT FILE$" has been deleted.
4020 PRINT
4030 INPUT "Delete another";DELAGAIN$
4040 IF DELAGAIN$="y" OR DELAGAIN$="Y" THEN 3830
4050 PRINT
4060 RETURN
4070 '
4080 ' This is the end of the routine for deleting files.
4090 '
4100 '
4110 '
4120 ' Here is the routine for making a directory.
4130 '
4140 'LABEL makedir
4150 'on error goto 0
4160 CLS
4170 PRINT " Make a Directory"
4180 PRINT
4190 PRINT
4200 ' LABEL makeagn
4210 INPUT "Directory name (include drive and path) ",DIRECTORY$
4220 MKDIR DIRECTORY$
4230 PRINT
4240 PRINT
4250 PRINT "You have created directory: "DIRECTORY$
4260 PRINT
4270 PRINT
4280 INPUT "Would you like to make another directory";MAKEAGN$
4290 IF MAKEAGN$="y" OR MAKEAGN$="Y" THEN PRINT
4300 IF MAKEAGN$="y" OR MAKEAGN$="Y" THEN PRINT
4310 IF MAKEAGN$="y" OR MAKEAGN$="Y" THEN 4200
4320 IF MAKEAGN$="n" OR MAKEAGN$="N" THEN RETURN
4330 CLS
4340 GOTO 4280
4350 '
4360 ' This is the end of the routine for making directories.
4370 '
4380 '
4390 '
4400 'Here is the routine for removing directories.
4410 '
4420 'LABEL removdir
4430 ON ERROR GOTO 0
4440 CLS
4450 PRINT " Remove a Directory"
4460 PRINT
4470 PRINT
4480 PRINT "Before you can remove a directory, you must remove all files in that"
4490 PRINT "directory, and its subdirectories. You must then remove all subdirectories."
4500 PRINT
4510 PRINT
4520 'LABEL removagn
4530 INPUT "Which drive (Q and Enter to quit)";DRIVE$
4540 IF DRIVE$="q" OR DRIVE$="Q" THEN RETURN
4550 PRINT
4560 INPUT "Directory name (include path) or Q to quit";DIRECTORY$
4570 'LABEL redir
4580 IF DIRECTORY$="q" OR DIRECTORY$="Q" THEN RETURN
4590 DIRECTORY$=DRIVE$+"\"+DIRECTORY$
4600 CLS
4610 PRINT "Here are the contents of "DIRECTORY$":"
4620 FILES DIRECTORY$+"\"
4630 PRINT "If this directory is not empty, you will have to delete any files and"
4640 PRINT "remove any subdirectories before you can remove it."
4650 PRINT
4660 PRINT
4670 'LABEL rdoptions
4680 PRINT "Here are your options:"
4690 PRINT
4700 PRINT "1- Delete directory files."
4710 PRINT
4720 PRINT "2- Remove subdirectories."
4730 PRINT
4740 PRINT "3- Continue."
4750 PRINT
4760 PRINT "4- Return to the Main Options Menu."
4770 PRINT
4780 INPUT "Please press the number corresponding to your choice, and then press Enter: ",DOWHAT$
4790 IF DOWHAT$="1" THEN CLS:GOTO 4930
4800 IF DOWHAT$="2" THEN CLS:GOTO 4520
4810 IF DOWHAT$="3" THEN CLS:GOTO 4830
4820 IF DOWHAT$="4" THEN CLS:RETURN
4830 'LABEL rmdrcont
4840 RMDIR DIRECTORY$
4850 PRINT
4860 PRINT
4870 PRINT "You have removed directory: "DIRECTORY$
4880 PRINT
4890 PRINT
4900 INPUT "Would you like to remove another directory";RMDAGAIN$
4910 IF RMDAGAIN$="y" OR RMDAGAIN$="Y" THEN 4520
4920 RETURN
4930 'LABEL deldirfl
4940 CLS
4950 PRINT "Here are the files in "DIRECTORY$":"
4960 PRINT
4970 PRINT
4980 FILES DIRECTORY$+"\"
4990 PRINT
5000 PRINT
5010 INPUT "Which file (include path, Q to quit)";WHICHFIL$
5020 IF WHICHFIL$="q" OR WHICHFIL$="Q" THEN CLS:FILES DIRECTORY$+"\":PRINT:PRINT:PRINT:PRINT:PRINT:GOTO 4670
5030 WHICHFIL$=DRIVE$+"\"+WHICHFIL$
5040 KILL WHICHFIL$
5050 PRINT
5060 PRINT
5070 PRINT WHICHFIL$" has been deleted."
5080 PRINT
5090 INPUT "Delete another";ANOTHER$
5100 IF ANOTHER$="y" OR ANOTHER$="Y" THEN 4930
5110 CLS:FILES DIRECTORY$+"\":PRINT:PRINT:PRINT:PRINT:PRINT:GOTO 4670
5120 '
5130 'This is the end of the routine for removing directories.
5140 '
5150 '
5160 '
5170 'Here is the routine for renaming files.
5180 '
5190 'LABEL renfile
5200 ON ERROR GOTO 0
5210 CLS
5220 PRINT " Rename Files"
5230 'LABEL renamagn
5240 PRINT
5250 PRINT
5260 INPUT "Drive (Press Q to quit)";DRIVE$
5270 IF DRIVE$="q" OR DRIVE$="Q" THEN RETURN
5280 PRINT
5290 PRINT "Name of file to change (include path)?"
5300 INPUT "Q to quit. ",FILE1$
5310 IF FILE1$="q" OR FILE1$="Q" THEN RETURN
5320 PRINT
5330 PRINT "New name for "FILE1$" (Q to quit)";
5340 INPUT FILE2$
5350 IF FILE2$="q" OR FILE2$="Q" THEN RETURN
5360 'LABEL refile
5370 FILE1$=DRIVE$+"\"+FILE1$
5380 FILE2$=DRIVE$+"\"+FILE2$
5390 NAME FILE1$ AS FILE2$
5400 PRINT
5410 PRINT FILE1$" has been renamed "FILE2$
5420 PRINT
5430 INPUT "Rename another";RENAGN$
5440 IF RENAGN$="y" OR RENAGN$="Y" THEN 5230
5450 RETURN
5460 '
5470 'This is the end of the routine for renaming files.
5480 '
5490 '
5500 '
5510 'Here is the routine for displaying file contents.
5520 '
5530 'LABEL displafl
5540 ON ERROR GOTO 0
5550 CLS
5560 'LABEL displagn
5570 PRINT " View File Contents"
5580 PRINT
5590 PRINT
5600 PRINT "Which file (include drive and path)?"
5610 INPUT "Press Q and Enter to quit. ",WHATFILE$
5620 IF WHATFILE$="q" OR WHATFILE$="Q" THEN RETURN
5630 CLS
5640 PRINT "To pause, press Ctrl-Num Lock."
5650 PRINT
5660 PRINT "Special characters used in ";WHATFILE$
5670 PRINT "may not print in exactly the same manner as in the original."
5680 PRINT
5690 PRINT "Also, formatting may not be quite correct."
5700 'LABEL refiledf
5710 GOSUB 6630
5720 CLS
5730 OPEN WHATFILE$ FOR INPUT AS 1
5740 WHILE NOT EOF(1)
5750 LINE INPUT # 1, A$
5760 PRINT A$
5770 WEND
5780 CLOSE 1
5790 PRINT
5800 INPUT "Do you want to view more files";VIEWMORE$
5810 IF VIEWMORE$="y" OR VIEWMORE$="Y" THEN 5560
5820 RETURN
5830 '
5840 'This is the end of the routine for displaying files.
5850 '
5860 '
5870 '
5880 'Here is the routine for listing the devices for CONFIG.SYS
5890 '
5900 'Label LISTSYS
5910 ON ERROR GOTO 6690
5920 PRINT
5930 IF DRIVE$="a:\" THEN FILE$="a:\*.sys
5940 IF DRIVE$="A:\" THEN FILE$="a:\*.sys
5950 IF DRIVE$="b:\" THEN FILE$="b:\*.sys
5960 IF DRIVE$="B:\" THEN FILE$="b:\*.sys
5970 IF DRIVE$="c:\" THEN FILE$="c:\*.sys
5980 IF DRIVE$="C:\" THEN FILE$="c:\*.sys
5990 IF DRIVE$="d:\" THEN FILE$="d:\*.sys
6000 IF DRIVE$="D:\" THEN FILE$="D:\*.sys
6010 INPUT "Do you want a list of the system devices available (y/n)";SYSLIST$
6020 IF SYSLIST$="y" OR SYSLIST$="Y" THEN CLS:FILES FILE$:PRINT "(Don't count CONFIG.SYS as a system device)":PRINT:PRINT:ON ERROR GOTO 0:RETURN
6030 ON ERROR GOTO 0
6040 IF SYSLIST$="n" OR SYSLIST$="N" THEN RETURN
6050 PRINT "Please press either Y or N, then press Enter.":GOTO 5900
6060 '
6070 'This is the end of the routine for listing the devices for CONFIG.SYS
6080 '
6090 '
6100 '
6110 'Here is the routine for looking at the AUTOEXEC.BAT file.
6120 '
6130 'Label AUTOLOOK
6140 IF DRIVE$="a:\" THEN FILE$="a:\autoexec.bat
6150 CLS
6160 PRINT "Here is your file:"
6170 PRINT
6180 PRINT
6190 OPEN FILE$ FOR INPUT AS 1
6200 WHILE NOT EOF(1)
6210 LINE INPUT # 1, A$
6220 PRINT A$
6230 WEND
6240 GOSUB 6630
6250 CLOSE # 1
6260 RETURN
6270 IF DRIVE$="A:\" THEN FILE$="a:\autoexec.bat
6280 IF DRIVE$="b:\" THEN FILE$="b:\autoexec.bat
6290 IF DRIVE$="B:\" THEN FILE$="b:\autoexec.bat
6300 IF DRIVE$="c:\" THEN FILE$="c:\autoexec.bat
6310 IF DRIVE$="C:\" THEN FILE$="c:\autoexec.bat
6320 IF DRIVE$="d:\" THEN FILE$="d:\autoexec.bat
6330 IF DRIVE$="D:\" THEN FILE$="d:\autoexec.bat
6340 '
6350 'This is the end of the routine for looking at the AUTOEXEC.BAT file.
6360 '
6370 '
6380 '
6390 'Here is the routine for adding lines to the end of AUTOEXEC.BAT.
6400 '
6410 'Label APPNDAUT
6420 IF DRIVE$="a:\" THEN FILE$="a:\autoexec.bat
6430 IF DRIVE$="A:\" THEN FILE$="a:\autoexec.bat
6440 IF DRIVE$="b:\" THEN FILE$="b:\autoexec.bat
6450 IF DRIVE$="B:\" THEN FILE$="b:\autoexec.bat
6460 IF DRIVE$="c:\" THEN FILE$="c:\autoexec.bat
6470 IF DRIVE$="C:\" THEN FILE$="c:\autoexec.bat
6480 IF DRIVE$="d:\" THEN FILE$="d:\autoexec.bat
6490 IF DRIVE$="D:\" THEN FILE$="d:\autoexec.bat
6500 OPEN FILE$ FOR APPEND AS 1
6510 'Label APPNDAGN
6520 PRINT
6530 INPUT "Line to add (Q to quit)";APPENDLN$
6540 IF APPENDLN$="q" OR APPENDLN$="Q" THEN CLOSE # 1:RETURN
6550 PRINT# 1, APPENDLN$
6560 GOTO 6510
6570 '
6580 'This is the end of the routine for adding to the end of AUTOEXEC.BAT.
6590 '
6600 '
6610 '
6620 'Here is the routine for continuing when the user is ready.
6630 'LABEL continue
6640 PRINT
6650 PRINT
6660 PRINT "Press any key to continue. ";
6670 IF INKEY$="" THEN 6670
6680 RETURN
6690 IF ERR=53 THEN PRINT "No system drivers available.":RESUME NEXT