DOS 24
Fix.bat By AndrzejL on 20th March 2025 04:19:18 PM
  1. @echo off
  2. :: Check if running with administrator privileges
  3. net session >nul 2>&1
  4. if %errorlevel% neq 0 (
  5.     echo This script requires administrative privileges. Elevating...
  6.     powershell -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  7.     exit /b
  8. )
  9.  
  10. :: Keep Windows awake
  11. start cmd /c "echo Keep this window open. Your System will restart when its done scanning itself. & @echo off & for /l %%x in (0,0,0) do (powershell -command "$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('{NUMLOCK}')" & timeout /t 10 >nul)"
  12.  
  13. :: Code below will run with admin privilages
  14. echo Admin privileges acquired.
  15. echo Starting quick Antivirus Scan
  16. echo %time%
  17. "%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 1 -Trace
  18. echo If threats were found - remove all.
  19. echo %time%
  20. "%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Remove -All
  21. echo Starting system Scan
  22. echo %time%
  23. echo DISM-ing the system
  24. echo %time%
  25. DISM.exe /Online /Cleanup-image /Restorehealth
  26. echo SFC-ing the system
  27. echo %time%
  28. SFC /Scannow
  29. echo System scan done
  30. echo %time%
  31. echo Rebooting the system
  32. echo %time%
  33. shutdown -r -t 1

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.