home *** CD-ROM | disk | FTP | other *** search
- chngauto:
- cls
- print " View or Change Your AUTOEXEC.BAT File
- print
- print
- input "On which drive is your AUTOEXEC.BAT file";drive$
- redrivea:
- drive$=drive$+"\"
- if drive$="a:\" then file1$="a:\autoexec.bat"
- if drive$="A:\" then file1$="a:\autoexec.bat"
- if drive$="b:\" then file1$="b:\autoexec.bat"
- if drive$="B:\" then file1$="b:\autoexec.bat"
- if drive$="c:\" then file1$="c:\autoexec.bat"
- if drive$="C:\" then file1$="c:\autoexec.bat"
- if drive$="d:\" then file1$="d:\autoexec.bat"
- if drive$="D:\" then file1$="d:\autoexec.bat"
- if drive$="e:\" then file1$="e:\autoexec.bat"
- if drive$="E:\" then file1$="e:\autoexec.bat"
-
- if drive$="a:\" then file2$="a:\autoexec.bak"
- if drive$="A:\" then file2$="a:\autoexec.bak"
- if drive$="b:\" then file2$="b:\autoexec.bak"
- if drive$="B:\" then file2$="B:\autoexec.bak"
- if drive$="c:\" then file2$="c:\autoexec.bak"
- if drive$="C:\" then file2$="c:\autoexec.bak"
- if drive$="d:\" then file2$="d:\autoexec.bak"
- if drive$="D:\" then file2$="d:\autoexec.bak"
- if drive$="e:\" then file2$="e:\autoexec.bak"
- if drive$="E:\" then file2$="e:\autoexec.bak"
-
- automenu:
- cls
- print "You have the following options:"
- print
- print
- print "1- Just view the AUTOEXEC.BAT file."
- print
- print "2- Add lines to the end of your file."
- print
- print "3- Create a new AUTOEXEC.BAT file."
- print
- print "4- Return to the Main Options Menu.
- print
- print
- print
- input "Please press the number corresponding to your choice, and then press Enter. ",chngauto$
-
- if chngauto$="1" then
- cls
- gosub autolook
- goto automenu
- elseif chngauto$="2" then
- cls
- gosub appndaut
- gosub autolook
- goto automenu
- elseif chngauto$="3" then
- cls
- goto newauto
- elseif chngauto$="4" then
- cls
- goto finish
- else
- goto automenu
- end if
-
-
- ' This routine creates a new AUTOEXEC.BAT file.
-
- newauto:
- cls
- open file1$ for input as 1
- open file2$ for output as 2
- while not eof(1)
- line input # 1, a$
- print # 2, a$
- wend
- close # 1
- close # 2
- kill file1$
- cls
- print "Your AUTOEXEC.BAT file has been changed to AUTOEXEC.BAK in order to
- print "save it for later use. To use it later, you will have to
- print "rename it AUTOEXEC.BAT after renaming the current AUTOEXEC.BAT to
- print "something else (for example, AUTOEXEC.X)."
- print
- print
- print "Press any key to continue. ";
- gosub presskey
-
- scndchng:
- cls
- open file1$ for output as 1
- print "Please type the first line you want, then press Enter (Q to quit).
- print
- input "> ",firstln$
-
- if firstln$="q" then
- goto nochange
- elseif firstln$="Q" then
- goto nochange
- end if
-
- print # 1, firstln$
-
- contline:
- print
- print "Please type your next line, followed by Enter (Q to quit).
- print
- input "> ",nextline$
-
- if nextline$="q" then
- goto stopchng
- elseif nextline$="Q" then
- goto stopchng
- end if
-
- print # 1, nextline$
- goto contline
-
- stopchng:
- close # 1
- cls
- gosub autolook
- print
- print
- print
- print "If this is not O.K. AND you want to change it, press C and then Enter."
- print
- print "To restore your original AUTOEXEC.BAT, press R and then Enter.
- print
- input "If you're happy with it as is, type OK and Enter. ",changeyn$
-
- rechange:
- if changeyn$="c" then
- goto scndchng
- elseif changeyn$="C" then
- goto scndchng
- elseif changeyn$="r" then
- goto nochange
- elseif changeyn$="R" then
- goto nochange
- elseif changeyn$="ok" then
- goto automenu
- elseif changeyn$="OK" then
- goto automenu
- elseif changeyn$="oK" then
- goto automenu
- elseif changeyn$="Ok" then
- goto automenu
- end if
-
- print
- input "You must choose C, R, or OK. ",changeyn$
- goto rechange
-
- nochange:
- cls
- reset
- kill file1$
- open file2$ for input as 1
- open file1$ for output as 2
-
- while not eof(1)
- line input # 1, a$
- print # 2, a$
- wend
-
- reset
- print "Your original AUTOEXEC.BAT file has been restored.
- print
- print
- print "Press any key to continue. ";
- gosub presskey
- goto automenu
-
- ' This is the end of the routine for working with the AUTOEXEC.BAT file.
-
-
- ' Here is the routine for looking at the AUTOEXEC.BAT file.
-
- autolook:
- cls
- reset
- print "Here is your file:"
- print
- print
- open file1$ for input as 1
-
- while not eof(1)
- line input # 1, a$
- print a$
- wend
-
- close # 1
- print
- print
- print "Press any key to continue. ";
- gosub presskey
- return
-
- ' This is the end of the routine for looking at the AUTOEXEC.BAT file.
-
-
- ' Here is the routine for adding lines to the end of AUTOEXEC.BAT.
-
- appndaut:
- cls
- reset
- open file1$ for append as 1
-
- appndagn:
- print
- input "Line to add (Q to quit)";appendln$
-
- if appendln$="q" then
- close # 1
- return
- elseif appendln$="Q" then
- close # 1
- return
- end if
-
- print # 1, appendln$
- goto appndagn
-
- ' This is the end of the routine for adding to the end of AUTOEXEC.BAT.
-
-
- 'Here is the routine for continuing when the user presses a key.
-
- presskey:
- wait:
- a$=inkey$
- if a$="" then goto wait
- return
-
-
- 'Here is the routine for ending the program.
-
- finish:
- end
-