Advertisement
JWLLEWELYN

CafeAgent_Exclusion.cmd

May 28th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.94 KB | None | 0 0
  1. @echo off
  2. rem Autor: JWLLEWELYN
  3. rem Description: script that allows to enable the execution of programs.
  4.  
  5. set "params=%*"
  6. cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || (  echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
  7.  
  8. :check
  9. IF EXIST "%~dp0overlay.xml" (
  10.   goto apply
  11. ) ELSE (
  12. echo.
  13. color 4F
  14. echo "The file "overlay.xml" can not be found in the root directory."
  15.   timeout /t 10
  16.   exit
  17. )
  18.  
  19.  
  20. :apply
  21. IF EXIST "%PROGRAMDATA%\CafeAgent\overlay.xml" (
  22.   copy /y /v /b "%~dp0overlay.xml" "%PROGRAMDATA%\CafeAgent"
  23. echo.
  24. color 2F
  25. echo "The settings have been saved correctly."
  26.   timeout /t 10
  27. ) ELSE (
  28. echo.
  29. color 4F
  30. echo "The CafeAgent is not installed. you can not apply the settings."
  31.   timeout /t 10
  32. )
  33. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement