home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!spencer
- From: spencer@cats.ucsc.edu (Michael Spencer)
- Newsgroups: comp.os.msdos.programmer
- Subject: Re: batch question
- Message-ID: <1ii4vvINNbqs@darkstar.UCSC.EDU>
- Date: 7 Jan 93 20:49:03 GMT
- References: <Gary_Angove.0bxs@abcd.Houghton.MI.US>
- Organization: University of California, Santa Cruz
- Lines: 43
- NNTP-Posting-Host: si.ucsc.edu
-
-
- Gary_Angove@abcd.Houghton.MI.US (Gary Angove) writes:
-
- >I would like to use a batch program from the AUTOEXEC that would preform a
- >particular task dependant on the date.
- >Such as, ...
- >.........IF CURRENT DATE IS EQUAL TO (SOME DATE) DO....
- >Can this be done through the AUTOEXEC? HELP!!!!
-
-
- Unfortunately, the answer is NO
- because batch files cannot effectively access the time program.
-
- WORKAROUNDS:
- (1) Write a C program which returns an exit value based on time(),
- then access the result in the batch file, eg:
- CTimer
- if errorlevel --- goto Job1 etc
- This is clumsy and limited, but may work for you.
-
- (2) Use PERL to write a script.
- This is much more sophisticated, flexible, & powerful
- but puts you on the learning curve for that language
- -- no pain, no gain -- PERL can be used for all kinds
- of job control functions. If it can be done at all,
- you can do it in PERL. A DOS version of the language
- is available from any SIMTEL mirror.
-
-
- ===========================================================================
- Mike Spencer |
- spencer@cats.ucsc.edu | Reality doesn't care about my opinion.
- 2640 Borregas |
- Aptos, CA 95003 |
- ===========================================================================
-
- --
-
- ===========================================================================
- Michael Spencer |
- spencer@cats.ucsc.edu | Reality doesn't care about your opinion.
- (408) 688-7798 |
- ===========================================================================
-