⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manager.bas

📁 StarCom Manager 3.06 用QB编写的管理程序
💻 BAS
📖 第 1 页 / 共 3 页
字号:
'THIS IS THE END OF THE ROUTINE FOR ADDING LINES TO CONFIG.SYS.


'HERE IS THE ROUTINE FOR LISTING THE DEVICES FOR CONFIG.SYS.

listsys:

PRINT

'The user may not want the devices listed.  If that's the case, we just
'return to the main routine; everything happens fast enough that it's all
'transparent to the user.  This lets us keep the main routine relatively
'clean, and makes it a little easier to read.

PRINT "Do you want a list of the system devices available (y/n)? ";

wait19:
GOSUB continue
IF UCASE$(a$) = "Y" THEN GOTO dolist
IF UCASE$(a$) = "N" THEN RETURN
GOTO wait19

dolist:
CLS
PRINT "If you know where your .SYS files are located, please type in the"
PRINT "drive and path.  Pressing Enter will cause The Manager to look for"
PRINT "the files on the default drive and directory."
PRINT
PRINT "> ";
GOSUB retypefi
IF a$ = CHR$(27) THEN return
CLS
PRINT "(Don't count CONFIG.SYS as a system device)"
PRINT
PRINT
file$ = file$ + "\*.sys"
FILES file$
file$ = ""
PRINT
PRINT
PRINT "Press any key to continue. ";
GOSUB continue
PRINT
PRINT
RETURN

'THIS IS THE END OF THE ROUTINE FOR LISTING THE DEVICES FOR CONFIG.SYS.

'THIS IS THE END OF THE ROUTINE FOR WORKING WITH CONFIG.SYS.


'HERE IS THE ROUTINE FOR WORKING WITH AUTOEXEC.BAT.

chngauto:
ON ERROR GOTO 0
CLS
PRINT SPACE$(68);
COLOR 0, 7
PRINT "Esc=Quit"
COLOR 7, 0
PRINT
PRINT "                     View or Change Your AUTOEXEC.BAT File"
PRINT
PRINT
PRINT "On which drive is your AUTOEXEC.BAT file? ";
GOSUB retypefi
IF a$ = CHR$(27) THEN GOTO menu

redrivea:
file1$ = UCASE$(file$) + "\autoexec.bat"
file2$ = UCASE$(file$) + "\autoexec.bak"
file$ = ""

automenu:
CLS
PRINT "You have the following options:"
PRINT
PRINT
PRINT "F1- Just view the AUTOEXEC.BAT file."
PRINT
PRINT "F2- Add lines to the end of your file."
PRINT
PRINT "F3- Create a new AUTOEXEC.BAT file."
PRINT
PRINT "Esc- Return to the Main Options Menu."
PRINT
PRINT
PRINT "Please press the key corresponding to your choice. ";

wait4:
GOSUB continue
IF a$ = CHR$(27) THEN GOTO menu

IF a$ = CHR$(0) + CHR$(59) THEN
CLS
GOSUB autolook
GOTO automenu
END IF

IF a$ = CHR$(0) + CHR$(60) THEN
CLS
GOSUB appndaut
GOSUB autolook
GOTO automenu
END IF

IF a$ = CHR$(0) + CHR$(61) THEN
CLS
GOTO newauto
END IF

GOTO wait4


'THIS ROUTINE CREATES A NEW AUTOEXEC.BAT FILE.

newauto:
CLS
NAME file1$ AS file2$
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 continue

scndchng:
CLS
PRINT SPACE$(68);
COLOR 0, 7
PRINT "Esc=Quit"
COLOR 7, 0
OPEN "o", 1, file1$
PRINT "Please type the first line you want, then press Enter."
PRINT
PRINT "> ";
GOSUB retypefi
IF a$ = CHR$(27) THEN GOTO nochange
PRINT #1, file$
file$ = ""

contline:
PRINT
PRINT "Please type your next line, followed by Enter."
PRINT
PRINT "> ";
GOSUB retypefi
IF a$ = CHR$(27) THEN GOTO stopchng
PRINT #1, file$
file$ = ""
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
PRINT "If you're happy with it as is, type OK and Enter."
PRINT
PRINT "> ";
GOSUB retypefi

rechanga:

IF UCASE$(file$) = "C" THEN
file$ = ""
GOTO scndchng
END IF

IF UCASE$(file$) = "R" THEN
file$ = ""
GOTO nochange
END IF

IF UCASE$(file$) = "OK" THEN
file$ = ""
GOTO automenu
END IF

PRINT
PRINT "You must choose C, R, or OK."
PRINT
file$ = ""
GOSUB retypefi
GOTO rechanga:

nochange:
CLS
CLOSE 1
CLOSE 2
KILL file1$
NAME file2$ AS file1$
PRINT "Your original AUTOEXEC.BAT file has been restored."
PRINT
PRINT
PRINT "Press any key to continue. ";
GOSUB continue
GOTO automenu


'HERE IS THE ROUTINE FOR LOOKING AT THE AUTOEXEC.BAT FILE.

autolook:
CLS
CLOSE 1
CLOSE 2
PRINT "Here is your file:"
PRINT
PRINT
OPEN "i", 1, file1$

nextline:
LINE INPUT #1, line$
PRINT line$

IF EOF(1) THEN
CLOSE 1
PRINT
PRINT
PRINT "Press any key to continue. ";
GOSUB continue
RETURN
END IF

GOTO nextline

'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
CLOSE 1
CLOSE 2
OPEN "a", 1, file1$

appndagn:
PRINT
PRINT "Line to add (Esc when done)? ";
GOSUB retypefi

IF a$ = CHR$(27) THEN
CLOSE 1
RETURN
END IF

PRINT #1, file$
GOTO appndagn

'THIS IS THE END OF THE ROUTINE FOR ADDING TO THE END OF AUTOEXEC.BAT.

'THIS IS THE END OF THE ROUTINE FOR WORKING WITH AUTOEXEC.BAT.


'HERE IS THE ROUTINE FOR MAKING A DIRECTORY.

makedir:
ON ERROR GOTO makedire
CLS
PRINT "                               Make a Directory"
PRINT
PRINT
PRINT SPACE$(68);
COLOR 0, 7
PRINT "Esc=Quit"
COLOR 7, 0
PRINT "Directory name (include drive and path)? ";
GOSUB retypefi
IF a$ = CHR$(27) THEN goto menu

remakedr:
MKDIR file$
PRINT
PRINT
PRINT "You have created directory: "; UCASE$(file$)
file$ = ""
PRINT
PRINT
PRINT "Would you like to make another directory? (y/n) ";

wait14:
GOSUB continue
IF UCASE$(a$) = "Y" THEN GOTO makedir
IF UCASE$(a$) = "N" THEN goto menu
GOTO wait14

'THIS IS THE END OF THE ROUTINE FOR MAKING DIRECTORIES.


'HERE IS THE ROUTINE FOR REMOVING A DIRECTORY.

removedr:
ON ERROR GOTO 0
CLS
PRINT "                              Remove a Directory"
PRINT
PRINT
PRINT SPACE$(68);
COLOR 0, 7
PRINT "Esc=Quit"
COLOR 7, 0
PRINT "Before you can remove a directory, you must remove ALL files in that"
PRINT "directory, and its subdirectories.  You must then remove all subdirectories."
PRINT
PRINT

removagn:
PRINT "Directory name (include drive and path)? ";
GOSUB retypefi

if subdir=0 then 'Here, we're not looking at any subdirectories yet.
Directory$ = file$ 'So, file$ and directory$ are the same.
file$=""
else
subdir$=file$ 'Otherwise, use subdir$ and leave directory$ for the main dir.
file$=""
endif

redir:

IF a$ = CHR$(27) THEN 
subdir=0
GOTO menu
endif

CLS

if subdir=0 then
PRINT "Here are the contents of "; UCASE$(Directory$); ":"
PRINT
FILES Directory$ + "\"
endif

if subdir=1 then
print "Here are the contents of "ucase$(subdir$)":"
print
files subdir$+"\"
endif

PRINT
PRINT "If this directory is not empty, you will have to delete any files and"
PRINT "remove any subdirectories before you can remove it."
PRINT
PRINT

rdoptions:
PRINT "Here are your options:"
PRINT
PRINT "F1- Delete directory files."
PRINT
PRINT "F2- Remove subdirectories."
PRINT
PRINT "F3- Continue."
PRINT
PRINT "Esc- Return to Main Options Menu."
PRINT
PRINT
PRINT "Please press the key corresponding to your choice. ";

remvwait:
GOSUB continue
IF a$ = CHR$(0) + CHR$(59) THEN GOTO deldirfl

IF a$ = CHR$(0) + CHR$(60) THEN
CLS
subdir=1

if subdir$="" then
FILES Directory$ + "\"
else
files subdir$+"\"
endif

GOTO removagn
END IF

IF a$ = CHR$(0) + CHR$(61) THEN GOTO rmdrcont

IF a$ = CHR$(27) THEN 
file$=""
directory$=""
subdir=0
subdir$=""
GOTO menu
endif

GOTO remvwait

rmdrcont:

if subdir=1 then
rmdir subdir$
print
print
print "You have removed directory; ";ucase$(subdir$)
print
print
print "Would you like to remove another directory? ";
goto remagain
endif

RMDIR Directory$
PRINT
PRINT
PRINT "You have removed directory: "; UCASE$(Directory$)
PRINT
PRINT
PRINT "Would you like to remove another directory? ";

remagain:
GOSUB continue

IF UCASE$(a$) = "Y" THEN
CLS
FILES Directory$ + "\"
GOTO removagn
END IF

IF UCASE$(a$) = "N" THEN 
subdir=0
file$=""
directory$=""
subdir$=""
GOTO menu
endif

GOTO remagain

deldirfl:
CLS
PRINT "Here are the files in "; 

if subdir=0 then
print UCASE$(Directory$); ":"
else
print ucase$(subdir$)":"
endif

PRINT
PRINT

if subdir=0 then
FILES Directory$ + "\"
else
files subdir$+"\"
endif

PRINT
PRINT
PRINT "Which file (include path)? ";
GOSUB retypefi

IF a$ = CHR$(27) THEN
CLS
FILES Directory$ + "\"
GOTO rdoptions
END IF

KILL file$
PRINT
PRINT
PRINT UCASE$(file$); " has been deleted."
PRINT
PRINT "Delete another? ";

delagain:
GOSUB continue
IF UCASE$(a$) = "Y" THEN
file$ = ""
GOTO deldirfl
END IF

IF UCASE$(a$) = "N" THEN
CLS
FILES Directory$ + "\"
PRINT
PRINT
PRINT
PRINT
PRINT
file$ = ""
GOTO rdoptions
END IF

'THIS IS THE END OF THE ROUTINE FOR REMOVING DIRECTORIES.


'HERE IS THE ROUTINE FOR CHANGING THE DEFAULT DIRECTORY.

changedr:
ON ERROR GOTO changede
CLS
PRINT SPACE$(68);
COLOR 0, 7
PRINT "Esc=Quit"
COLOR 7, 0
PRINT
PRINT
PRINT "                               Change Directory"
PRINT
PRINT
PRINT "Directory to change to? ";
GOSUB retypefi
IF a$ = CHR$(27) THEN goto menu

rechange:
CHDIR file$
PRINT
PRINT
PRINT "Your new default directory is "; UCASE$(file$); "."
PRINT
PRINT
PRINT "Press any key to return to the Main Options Menu. ";
GOSUB continue
file$ = ""
goto menu

'THIS IS THE END OF THE ROUTINE FOR CHANGING THE DEFAULT DIRECTORY.


'HERE IS THE ROUTINE FOR CHECKING FOR A GRAPHICS CARD.

chckgrph:
ON ERROR GOTO nographi 'Try for graphics mode.  If none, go to error handler.
SCREEN 1 'Graphics mode one.  If none, error prints "no graphics".
CLS
SCREEN 0
WIDTH 80
PRINT "The Manager detects a graphics card." 'If no error, you have graphics.
PRINT
PRINT
PRINT "Press any key to continue. ";
GOSUB continue
goto menu

'THIS IS THE END OF THE ROUTINE FOR CHECKING FOR A GRAPHICS CARD.


'HERE IS THE ROUTINE FOR BLANKING THE SCREEN.

blankscr:
CLS
GOSUB cursor 
LOCATE a, b, 0 'The "0" turns off the cursor, making a totally blank screen.
GOSUB continue 'Stay put until key pressed.

if menuflag=1 then 'Called from 40-column routine?
menuflag=0         'Clean house.
goto menu40        'Go to 40-column options menu.
else
goto menu          'If not, go to 80-column options menu.
endif

'THIS IS THE END OF THE ROUTINE FOR BLANKING THE SCREEN.


'HERE IS THE HELP SCREEN ROUTINE.

help:
CLS
PRINT "You can use arguments with The Manager if you wish; they may help"
PRINT "save you time."
PRINT
PRINT
PRINT "Just typing MANAGER at the DOS prompt will start The Manager from"
PRINT "the beginning; you can choose your options from the menu."
PRINT
PRINT "Typing MANAGER /? gives you this help screen."
PRINT
PRINT "Typing MANAGER /d moves you directly to the Delete Files option."
PRINT
PRINT "Typing MANAGER /m moves you directly to the Make Directory option."
PRINT
PRINT "Typing MANAGER /n moves you directly to the Rename Files option."
PRINT
PRINT "Typing MANAGER /g moves you directly to the Get Time/Date option."
PRINT
PRINT "Typing MANAGER /b blanks your screen."
PRINT
PRINT "Typing MANAGER /p checks for a graphics adaptor."
PRINT
PRINT
PRINT "Press any key to continue. ";
GOSUB continue
CLS
PRINT "Typing MANAGER /s lets you see a list of disk files."
PRINT
PRINT "Typing MANAGER /v lets you view the text file of your choice, on the"
PRINT "screen."
PRINT
PRINT "Typing MANAGER /l lets you print a file on the lineprinter."
PRINT
PRINT "Typing MANAGER /r lets you run other programs."
PRINT
PRINT "Typing MANAGER /e lets you remove directories."
PRINT
PRINT "Typing MANAGER /c lets you copy text files."
PRINT
PRINT "Typing MANAGER /cd lets you change your default directory."
PRINT
PRINT "Typing MANAGER /cr lets you use the Crapulator (Crappy Calculator)."
PRINT
PRINT "Typing MANAGER /a lets you see a list of ASCII codes."
PRINT
PRINT "Typing MANAGER /40 moves you directly to 40-column mode."
PRINT
PRINT
PRINT "Press any key to continue. ";
GOSUB continue
CLS
PRINT "Upper or lower case makes no difference."
PRINT
PRINT
PRINT "Do you want to ";
COLOR 0, 7
PRINT "C";
COLOR 7, 0
PRINT "ontinue with The Manager or return to ";
COLOR 0, 7
PRINT "D";
COLOR 7, 0
PRINT "OS? ";
GOSUB continue
IF UCASE$(a$) = "C" THEN goto menu2

IF UCASE$(a$) = "D" THEN
CLS
END
END IF

'THIS IS THE END OF THE ROUTINE FOR THE LIST OF DOS PARAMETERS.


'HERE IS THE ROUTINE FOR THE CRAPULATOR (CRAPPY CALCULATOR)

calculat:
CLS

'I left a lot of blank space because I hope to add lots of options in the 
'future.

PRINT "谀哪哪哪哪哪哪哪哪哪哪哪哪哪哪目"
PRINT "

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -