-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindows Integrity Verifier.bat
More file actions
63 lines (53 loc) · 1.74 KB
/
Windows Integrity Verifier.bat
File metadata and controls
63 lines (53 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@echo off
goto check_Permissions
:check_Permissions
echo -----------------------------------------------------------------
echo -------------------- Jake's Windows Verifier --------------------
echo -----------------------------------------------------------------
echo.
echo Admin Check: Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
echo Admin Check: Administrative permissions confirmed.
echo.
goto :startup
) else (
echo Admin Check: Administrative permissions missing.
echo Admin Check: Please start script as admin.
goto :exitprogram
)
pause >nul
:startup
set /P answer=Would you like to scan? "Y" or "N":
if /I "%answer%" EQU "Y" goto :sfcscannow
if /I "%answer%" EQU "N" goto :exitprogram
cls
goto :startup
:sfcscannow
sfc /scannow
goto :checkforwindowsimagerepair
:checkforwindowsimagerepair
set /P answer=Was an error found? "Y" or "N":
if /I "%answer%" EQU "Y" goto :windowsimagerepair
if /I "%answer%" EQU "N" goto :exitprogram
goto :checkforwindowsimagerepair
:windowsimagerepair
DISM.exe /Online /Cleanup-image /Restorehealth
echo Highly suggested to restart and scan again to ensure repair was successful.
set /P answer=Would you like to restart? "Y" or "N":
if /I "%answer%" EQU "Y" goto :restartcomputer
if /I "%answer%" EQU "N" goto :exitprogram
goto :checkforwindowsimagerepair
:restartcomputer
echo Now restarting...
shutdown.exe /r /t 00
exit
:exitprogram
echo.
echo -----------------------------------------------------------------
echo ----------------- Thanks for using this script! -----------------
echo ----------------------- Scripted by Jake! -----------------------
echo -----------------------------------------------------------------
echo.
pause
exit