home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / ibm / pc / misc / 14466 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.9 KB

  1. Xref: sparky comp.sys.ibm.pc.misc:14466 comp.os.msdos.misc:6050
  2. Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!ci922
  3. From: ci922@cleveland.Freenet.Edu (Duane A. Paulson)
  4. Newsgroups: comp.sys.ibm.pc.misc,comp.os.msdos.misc
  5. Subject: Re: Looking for a 'day of week checker' batch program
  6. Date: 7 Nov 1992 05:14:48 GMT
  7. Organization: Case Western Reserve University, Cleveland, OH (USA)
  8. Lines: 46
  9. Message-ID: <1dfjc9INNdoq@usenet.INS.CWRU.Edu>
  10. References: <BxAt8z.8K1@news.udel.edu>
  11. Reply-To: ci922@cleveland.Freenet.Edu (Duane A. Paulson)
  12. NNTP-Posting-Host: hela.ins.cwru.edu
  13.  
  14.  
  15. In a previous article, don@chopin.udel.edu (Donald R Lloyd) says:
  16.  
  17. >
  18. >
  19. >     I need to track down a small program for use in batch files that
  20. >will check to see if it is a certain day of the week and call a 
  21. >program or batch file if so.
  22. >     For example, when the user comes into work in the morning and
  23. >boots up, a line in the autoexec would do something along the lines of
  24. >
  25. >   "is_day tuesday tues.bat",
  26. >   
  27. >    so if today is tuesday it will call the batch file 'tues', otherwise
  28. >the line will be ignored.  
  29. >
  30. >     Anyone know if a program such as this exists, or will I have to 
  31. >track down a compiler somewhere and roll my own?
  32. >
  33. >
  34.  
  35. Cut the following and save to is_day.scr. From the dos prompt, type
  36. "debug < is_day.scr" to construct is_day.com. There is one blank line before
  37. the line containing "rcx" that must be included. The following dos functions
  38. are used:
  39.    2A -- get date function. Returns day of week (0=Sun...6=Sat) in al.
  40.    4C -- exit to system with errorlevel in al. (Therefore, errorlevel =         day of week.
  41.  
  42. ----------------------------------------------------------------------------
  43. n is_day.com
  44. a 100
  45. mov     ah,2a
  46. int     21
  47. mov     ah,4c
  48. int     21
  49.  
  50. rcx
  51. 8
  52. w
  53. q
  54. ----------------------------------------------------------------------------
  55.  
  56. -- 
  57. Duane Paulson
  58. ci922@cleveland.freenet.edu
  59. duane.paulson@pcb.batpad.lgb.ca.us
  60.