home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / msdos / programm / 11883 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.9 KB

  1. Path: sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!spencer
  2. From: spencer@cats.ucsc.edu (Michael Spencer)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: batch question
  5. Message-ID: <1ii4vvINNbqs@darkstar.UCSC.EDU>
  6. Date: 7 Jan 93 20:49:03 GMT
  7. References: <Gary_Angove.0bxs@abcd.Houghton.MI.US>
  8. Organization: University of California, Santa Cruz
  9. Lines: 43
  10. NNTP-Posting-Host: si.ucsc.edu
  11.  
  12.  
  13. Gary_Angove@abcd.Houghton.MI.US (Gary Angove) writes:
  14.  
  15. >I would like to use a batch program from the AUTOEXEC that would preform a
  16. >particular task dependant on the date.  
  17. >Such as, ...
  18. >.........IF CURRENT DATE IS EQUAL TO (SOME DATE) DO....
  19. >Can this be done through the AUTOEXEC?     HELP!!!!
  20.  
  21.  
  22. Unfortunately, the answer is NO
  23.     because batch files cannot effectively access the time program.
  24.  
  25. WORKAROUNDS:
  26.     (1) Write a C program which returns an exit value based on time(),
  27.         then access the result in the batch file, eg:
  28.              CTimer
  29.              if errorlevel --- goto Job1   etc
  30.         This is clumsy and limited, but may work for you.
  31.  
  32.     (2) Use PERL to write a script.
  33.         This is much more sophisticated, flexible, & powerful
  34.         but puts you on the learning curve for that language
  35.         -- no pain, no gain -- PERL can be used for all kinds
  36.         of job control functions. If it can be done at all,
  37.         you can do it in PERL.  A DOS version of the language 
  38.         is available from any SIMTEL mirror.
  39.  
  40.  
  41. ===========================================================================
  42. Mike Spencer               |
  43. spencer@cats.ucsc.edu      |    Reality doesn't care about my opinion.
  44. 2640 Borregas              |
  45. Aptos, CA   95003          |
  46. ===========================================================================
  47.  
  48. -- 
  49.  
  50. ===========================================================================
  51. Michael Spencer            |
  52. spencer@cats.ucsc.edu      |    Reality doesn't care about your opinion.
  53. (408) 688-7798             |
  54. ===========================================================================
  55.