home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / pcc / v08n03 / netwrk.exe / FAXBAT13.ZIP / SENDAFAX.BAT < prev    next >
DOS Batch File  |  1994-05-27  |  1KB  |  63 lines

  1. @echo off
  2.  
  3. rem     Syntax SENDAFAX (filename) (extension) (number) (sender)
  4.  
  5. rem     Drive I: must be mapped to directory containing faxes.
  6.  
  7. echo.
  8. echo Converting file %1.%2 for %4.
  9. echo.
  10.  
  11. c:
  12.  
  13. rem     This section will have to be rewritten for your fax software.
  14.  
  15. c:\ql2fax\convert i:%1.%2 /h
  16. if errorlevel 1 c:\ql2fax\convert i:%1.%2 /x /h
  17. if errorlevel 1 goto fail
  18.  
  19. echo.
  20. echo Sending file %1.%2 to %3 for %4.
  21. echo.
  22.  
  23. del c:\ql2fax\faxsend.log
  24. h:\errorlen %3
  25.  
  26. rem If the number is five digits or longer, prepend 0 to get through the PABX.
  27.  
  28. if not errorlevel 5 goto nozero
  29. c:\ql2fax\qld001 3 /f:i:%1 /fn:0%3
  30. goto wait
  31.  
  32. :nozero
  33. c:\ql2fax\qld001 3 /f:i:%1 /fn:%3
  34.  
  35. :wait
  36.  
  37. rem Wait for a log file to appear, and set errorlevel according to the result.
  38.  
  39. h:\logmon
  40. if errorlevel 1 goto fail
  41.  
  42. rem     This runs if fax was sent successfully.
  43.  
  44. z:\writelog f:\logs\faxmail.log %4 faxed %1.%2 to %3.
  45. if '%2' == 'CNM' f:\applic\pegasus\pmail -t %4 -f i:%1.%2 -s "fax sent to %3"
  46. if not '%2' == 'CNM' send "%2 file sent to %3" to %4
  47. goto end
  48.  
  49. :fail
  50.  
  51. rem     This runs if the fax failed to send.
  52.  
  53. z:\writelog f:\logs\faxmail.log %4 faxed %1.%2 to %3 (fail).
  54. if '%2' == 'CNM' f:\applic\pegasus\pmail -t %4 -f i:%1.%2 -s "fax NOT sent to %3"
  55. if not '%2' == 'CNM' send "%2 file NOT sent to %3" to %4
  56.  
  57. :end
  58.  
  59. rem     This must get run to clean things up.
  60.  
  61. h:
  62. del i:%1.*
  63.