home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast.iso
/
pcmag
/
vol13n05.zip
/
COUNT.ZIP
/
COUNTTYP.BAT
< prev
Wrap
DOS Batch File
|
1994-02-09
|
1KB
|
32 lines
@ECHO OFF
REM COUNTTYP.BAT - counts the number of times it has been executed
REM with a particular command line parameter
REM ******************************************************************
REM This is a self modifing batch file.
REM Make a backup before running to prevent loss of time and effort.
REM ******************************************************************
SET datatype=none
IF NOT '%1'=='' SET datatype=%1
REM The following line will increment the count.
ECHO rem data - %datatype% >> COUNTTYP.BAT
IF NOT "%2" == "0" GOTO :skipinit
REM The following line will initialize the file.
FIND /I /V "data - %datatype%" < COUNTTYP.BAT > COUNTTYP.BAT
:skipinit
REM The following lines will store the count in the environment.
FIND /I /C "data - %datatype%" COUNTTYP.BAT > counttmp.bat
ECHO SET count=%%2 > --------.BAT
CALL COUNTTMP.BAT
DEL COUNTTMP.BAT
DEL --------.BAT
REM The following line will display the results.
ECHO Current count of type "%datatype%" is: %count%
SET datatype=
REM This is the start of the data.