Advertisement
GlobalAccessSoftware

outlook_error_handler.bat

Nov 16th, 2023
924
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.09 KB | Software | 0 0
  1.  
  2.  
  3. ::::::::::::::::::::::::::::::::::::::::
  4. :: Error Handling For Outlook Module. ::
  5. ::::::::::::::::::::::::::::::::::::::::
  6. ::set vers=v7.9.9.02
  7. :err2
  8. set /a goat=7
  9. if %e% lss 0 set /a e=0
  10. if %e% equ 0 echo %l2%
  11. if %e% equ 0 goto return
  12.  
  13. :: Fatal Exceptions Defined:
  14. if %e% equ 1 echo **** Source Files NOT Found.
  15. if %e% equ 2 echo **** Destination Files NOT Found.
  16. if %e% equ 3 echo **** Error while copying Source to Destination:
  17. if %e% equ 3 set /a exit2=1
  18. ::
  19. if %e% lss 4 goto fadal
  20.  
  21. :: Non-Fatal exc-Eptions Handled:
  22. set m="ERROR!"
  23. set /a exc=0
  24. if %e% equ 4 set /a exc=1
  25. if %e% equ 4 set m=**** Daddio-PC not currently online.
  26. if %e% equ 6 set /a exc=2
  27. if %e% equ 6 set m=  **** Backup1 (I:) is not currently online.
  28. if %e% equ 8 set /a exc=3
  29. if %e% equ 8 set m= **** Seagate7 (X:) is not currently online.
  30. if %e% equ 10 set /a exc=4
  31. if %e% equ 10 set m=**** Gurujimon not currently online.
  32. if %e% equ 13 set /a exc=5
  33. if %e% equ 13 set m=**** Daddio-PC not currently online.
  34. if %e% equ 16 set /a exc=6
  35. if %e% equ 16 set m= **** Seagate1 (H:) is not currently online.
  36. if %e% equ 18 set /a exc=7
  37. if %e% equ 18 set m= **** Seagate16 (U:) is not currently online.
  38.  
  39. if %exc% gtr 0 if %exc% leq 7 goto nfadal
  40.  
  41.  
  42. :: Nearly-Fatal Exceptions Handled:
  43. if %e% equ 5 set /a exc=8
  44. if %e% equ 5 set m=**** Error while Copying to Daddio from Source.
  45. if %e% equ 7 set /a exc=9
  46. if %e% equ 7 set m=**** Error while Copying to Backup1 from Source.
  47. if %e% equ 9 set /a exc=10
  48. if %e% equ 9 set m=**** Error while Copying to Seagate7 from Source.
  49.  
  50. if %exc% gtr 0 if %exc% leq 10 goto nfadal
  51.  
  52. if %e% equ 11 set /a exc=11
  53. if %e% equ 11 set m=        **** Error Copying from D: to Gurujimon.
  54. if %e% equ 12 set /a exc=12
  55. if %e% equ 12 set m=      **** Error Copying from Gurujimon to Daddio.
  56. if %e% equ 14 set /a exc=13
  57. if %e% equ 14 set m=   **** Error Copying back from Daddio to Source.
  58. if %e% equ 17 set /a exc=14
  59. if %e% equ 17 set m=     **** Error Copying to Seagate1 from Source.
  60. if %e% equ 19 set /a exc=15
  61. if %e% equ 19 set m=     **** Error Copying to Seagate16 from Source.
  62.  
  63. :: The next 4 lines probably won't get hit,
  64. :: but are logical & implicitely inferential.
  65. if %e% lss 0 goto fadal
  66. if %e% gtr 19 goto fadal
  67. if %exc% lss 0 goto fadal
  68. if %exc% gtr 16 goto fadal
  69.  
  70.  
  71. :: LAST CHANCEs fir ALL FATAL-ERoS...
  72. :: Save for these, for they were forgiven!
  73. :nfadal
  74. echo %sl%
  75. echo                ******* EXCEPTION: #%exc%  *******
  76. echo %sl%
  77. echo          %m% ****
  78. echo %sl%
  79. echo .
  80. echo %sl%
  81. echo           *** Non-Fatal Program Continuing...  ***
  82. echo %sl%
  83. echo .
  84. ::
  85. set /a e=0
  86. :: e   ^ grants a reprieve for these non-fatal eros
  87. set /a goat=6
  88. goto return
  89.  
  90.  
  91. :fadal
  92. set /a goat=7
  93. echo %l1%
  94. REM echo .
  95. echo %time%
  96. echo           **** A Fatal Error Has Occurred! ****
  97. echo .
  98. echo %l2%
  99. set msg="Recommended Pause and Investigate? (y/N): "
  100. choice /c yn /n /t 90 /d n /m %msg%
  101. if %errorlevel% neq 1 echo %l2% & goto return
  102. echo %l1%
  103. echo **
  104. :: THIS PAUSE IS PROGRAMATIC, NOT JUST TE$TCODE! KEEP
  105. pause
  106. echo **
  107. pause
  108. echo **
  109.  
  110.  
  111. :return
  112.  
  113.  
  114.  
  115. ::: 100% -JpE- 20221218195021
  116.  
  117.  
  118.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement