home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1990
/
14
/
reconfig.bat
< prev
next >
Wrap
DOS Batch File
|
1990-07-03
|
2KB
|
63 lines
@ECHO OFF
CLS
IF "%1" == "" GOTO help
IF "%1" == "?" GOTO showfile
IF "%1" == "/h" GOTO help
GOTO start
:help
ECHO Name: RECONFIG.BAT Author: Kerry L. Nye
ECHO *
ECHO Syntax: RECONFIG [filespec] [?] [/h]
ECHO *
ECHO This batch file will reconfigure CONFIG.SYS to the
ECHO configuration specified in "filespec". It copies a
ECHO configuration file to CONFIG.SYS, copies an auto-
ECHO executing batch file to AUTOEXEC.BAT, and performs a
ECHO warmboot. It checks to see that both files exist in
ECHO the subdirectory where valid application-specific
ECHO CONFIG.SYS and AUTOEXEC.BAT files are maintained. If
ECHO not, it displays the files in the subdirectory, with an
ECHO appropriate error message. Calling RECONFIG without a
ECHO parameter or with parameter "/h" will display this
ECHO help, the current CONFIG.SYS and AUTOEXEC.BAT, and the
ECHO configuration file subdirectory. Calling RECONFIG with
ECHO parameter "?" displays the current CONFIG.SYS and
ECHO AUTOEXEC.BAT and the configuration file subdirectory.
ECHO RECONFIG accomplishes a warmboot by calling
ECHO WARMBOOT.COM. Consult the July 1989 PC Magazine
ECHO User-to-User column for information on WARMBOOT.COM.
ECHO *
PAUSE
GOTO showfile
:start
IF EXIST C:\SYS\%1.SYS GOTO onefile
ECHO %1.SYS does not exist on C:\SYS
GOTO nofile
:onefile
IF EXIST C:\SYS\%1.BAT GOTO yesfile
ECHO %1.BAT does not exist on C:\SYS
GOTO nofile
:yesfile
COPY C:\SYS\%1.SYS C:\CONFIG.SYS /V
COPY C:\SYS\%1.BAT C:\AUTOEXEC.BAT /V
WARMBOOT
GOTO END
:showfile
CLS
ECHO The current CONFIG.SYS is:
ECHO *
MORE < C:\CONFIG.SYS
PAUSE
ECHO The current AUTOEXEC.BAT is:
ECHO *
MORE < C:\AUTOEXEC.BAT
PAUSE
:nofile
ECHO *
ECHO The valid configuration files are:
DIR C:\SYS\*.SYS /W
PAUSE
ECHO The valid autoexec files are:
DIR C:\SYS\*.BAT /W
:end