Article View: comp.os.msdos.programmer
Article #7510Re: batch question
From: Michael Spencer
Date: Thu, 07 Jan 1993 20:49
Date: Thu, 07 Jan 1993 20:49
43 lines
2039 bytes
2039 bytes
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 | ===========================================================================
Technical Details
Message-ID:
<1ii4vvINNbqs@darkstar.UCSC.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!spencerReferences:
<Gary_Angove.0bxs@abcd.Houghton.MI.US>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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