Advertisement
GlobalAccessSoftware

Silent_mode.bat

Nov 16th, 2023
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.67 KB | Software | 0 0
  1.  
  2.  
  3. ::: RC8 Update! :::
  4.  
  5. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  6. ::: Silent_mode.bat by John Paul Edwards April 10, 2023
  7. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  8. ::: Launch AAA_Sync in Silent Mode, output to Logfile :::
  9. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10. :::     -- output to Logfile Pending: rev 8.2+ --
  11. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  12.  
  13.              :::::::[ PROGRAM MAIN ]:::::::
  14.   @echo off
  15.   if not defined vers set vers=v8.7.0.10 20231108073214 by -JpE-
  16.  
  17. :main
  18.   set titl2=Silent_mode.bat %vers% launched: %date% @ %time%
  19.   title %titl2%
  20.   if not defined bats set bats=C:\Users\%username%\Documents\AAA Sync2Laptop\Batch Files\BCS-Suite
  21.   if not exist "%bats%" echo . & echo Folder not found! & echo . & pause & exit
  22.   if not defined util1 set util1="%bats%\utility1.bat"
  23.   if not exist %util1% echo . & echo %util1% not found! & echo . & pause & exit
  24.   if not defined util3 set util3="%bats%\utility3.bat"
  25.   if not exist %util3% echo . & echo %util3% not found! & echo . & pause & exit
  26.  
  27. ::start
  28.   set ty1=25
  29.   if not defined code2 set /a code2=0  
  30.   call %util1% "shotcaller"
  31.  ::: Defaults to this ^ label if no arg passed.
  32.  
  33.  
  34.  
  35.   set oper=Silent
  36. ::: *** Test Code for ErrorHandling.bat
  37. if not defined testwell set testwell=0
  38. REM set testwell=1
  39. REM set testwell=3
  40. REM set /a code2=7
  41. REM echo . & pause & exit
  42.  
  43.  
  44. :ready
  45.   if %code2% equ 7 goto err1
  46.   set msg="Ready to Run Backups? (Y/n): "
  47.   choice /c yn /n /t 10 /d y /m %msg%
  48.   if %errorlevel% equ 2 goto return
  49.  
  50.   echo . & echo Proceeding... & echo .
  51.   set AAA="%bats%\AAA-Sync.bat"
  52.   if not exist %AAA% echo . & echo %AAA% not found! & echo . & goto err1
  53.   set filename1="%bats%\overrider3.txt"
  54.  ::: Purely a runtime file ^ see usages implementing override1 in %AAA% @:restart and the override1 var thereafter in several of the BCS code files. (Load Session, Use Search ALL Open Documents)
  55.   if exist %filename1% del /f /s /q %filename1%
  56.   copy %util1% %filename1% & call %AAA%
  57.   if exist %filename1% del /f /s /q %filename1%
  58.   title %titl2%
  59.  
  60.  
  61. :return
  62.   echo . & echo .
  63.   set msg="Review what happened? (y/N): "
  64.   choice /c yn /n /t %ty1% /d n /m %msg%
  65.   if %errorlevel% equ 1 echo . & pause & echo . & goto return
  66.   exit /b %errorlevel%
  67.  
  68.  
  69.                     :::::::[ Error and Exit Routines ]:::::::
  70. :err1
  71.   echo oopsie an error sent Flow here. Get on it!
  72.   set txt=OMG It fn Werked! Error Detected Successfully!
  73.   title %txt%  
  74.   set sender1=Silent_mode.bat
  75.   set errr="%bats%\ErrorHandling.bat"
  76.   if exist %errr% call %errr% "%txt%" "%sender1%"
  77.  REM goto return
  78.   goto ready
  79.  
  80.  
  81.  
  82. :::  100%  -JpE-
  83.  
  84.  
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement