Advertisement
J2897

Chocolatey Auto Updates

Feb 1st, 2021
1,332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.95 KB | None | 0 0
  1. @echo OFF
  2.  
  3. :: I added this to the Windows Task Scheduler to auto-update all of the Chocolatey
  4. :: installed programs because the "choco-upgrade-all-at" tool didn't seem to work.
  5. ::
  6. :: The speech program I use is Balcon if you want that too...
  7. :: http://www.cross-plus-a.com/bconsole.htm
  8.  
  9. REM Do OPENFILES to check for administrative privileges.
  10. openfiles >nul
  11. if errorlevel 1 (
  12.     color cf
  13.     echo Right-click on this file and select "Run as administrator".
  14.     pause
  15.     color
  16.     exit /b 1
  17. ) else echo Starting the Chocolatey upgrade process...
  18.  
  19. REM SAPI5 speech alert.
  20. if exist "%BALCON_EXE%" (
  21.     start "" /b /w "%BALCON_EXE%" -t "The Chocolatey installed programs are currently updating."
  22. )
  23.  
  24. REM Run the PowerShell command.
  25. title Chocolatey Upgrade All
  26. powershell.exe -Command "& {choco upgrade all -y}"
  27.  
  28. REM SAPI5 speech alert.
  29. if exist "%BALCON_EXE%" (
  30.     start "" /b /w "%BALCON_EXE%" -t "The updates have finished."
  31. )
  32.  
  33. REM End.
  34. title Done!
  35. pause
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement