AT2k Design BBS Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages! You are not logged in. Login here for full access privileges. |
Previous Message | Next Message | Back to BAT Magic <-- <--- | Return to Home Page |
|
||||||
From | To | Subject | Date/Time | |||
Visitor | ALL | 1ADAY |
November 2, 1995 11:19 AM * |
|||
I have come across a file with some good batch files original posted by PC World magazine. I'll post them here over the next few days or so. -+-[Cut here]---------------------------------------------------------- @echo off set BOOT= echo.| date | find "Current" > 1aday.$$1 if not exist today.dat goto FIRSTBOOT fc today.dat 1aday.$$1 | find "fc: no" > 1aday.$$2 copy 1aday.$$2 1aday.chk > nul if exist 1aday.chk goto NEXTBOOTS :FIRSTBOOT if exist today.dat del today.dat rename 1aday.$$1 today.dat set BOOT="FIRST" :NEXTBOOTS if exist 1aday.chk del 1aday.chk if exist 1aday.$$2 del 1aday.$$2 if exist 1aday.$$1 del 1aday.$$1 if "%BOOT%"=="" goto CONTINUE echo Welcome to the first boot of the day! rem -- Insert one-a-day commands here :CONTINUE -+-[Cut here]---------------------------------------------------------- Title: "Another Day, Another Boot" Reference: PC World April 1990 Author: Lee Foster Files: 1ADAY.DOC, 1ADAY.BAT The commands in 1ADAY.BAT let AUTOEXEC.BAT determine if it has run more than once on the same day. This allows you to issue DOS commands and run programs the first time you boot without repeating them if you reboot later on. You might use this to check an electronic mail box every morning or run a daily diagnostic. 1ADAY.BAT uses the DOS ECHO and DATE commands to store the current date in a temporary file 1ADAY.$$1. It then tests whether TODAY.DAT exists from a previous boot. If so, the program uses FC and FIND to compare TODAY.DAT with 1ADAY.$$1. If the files match, FIND writes the first few characters of FC's result string, "fc: no differences encountered" to a second temporary file, 1ADAY.$$2. Otherwise, that file will be empty, stopping COPY from creating a third temporary file, 1ADAY.CHK. (COPY won't copy a zero-length file.) If 1ADAY.CHK exists, the date in TODAY.DAT must be current, and the batch file jumps to NEXTBOOTS, leaving the BOOT environment variable blank. If the date is not current, 1ADAY.$$1 is renamed TODAY.DAT, and an environment variable BOOT is set to "FIRST," letting an IF statement determine if this is the first boot of the day. If your DOS version has COMP.COM instead of FC.EXE, replace the batch file's fifth line with the two lines `echo N| comp today.dat 1aday.$$1 | find "ok" > 1aday.$$2' and `cls'. The CLS erases COMP.COM's `Compare more files' prompt. Test the batch file by running it twice. The first time, you'll see a welcoming message. The next time, you won't--proving that the batch file correctly determined that it has already run that day. Copy the batch file commands into AUTOEXEC.BAT after your PATH command. Make sure the path includes the directory containing the FIND and FC (or COMP) DOS utilities. Replace the REM statement with the commands to execute once a day. ___ Blue Wave/QWK v2.12 |
||||||
|
Previous Message | Next Message | Back to BAT Magic <-- <--- | Return to Home Page |
Execution Time: 0.0136 seconds If you experience any problems with this website or need help, contact the webmaster. VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved. Virtual Advanced Copyright © 1995-1997 Roland De Graaf. |