-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathDisableDWM.bat
More file actions
227 lines (156 loc) · 6.31 KB
/
DisableDWM.bat
File metadata and controls
227 lines (156 loc) · 6.31 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
rem # Disable DWM
rem # Disabling Shell Infrastructure Host (sihost.exe) makes system much slower
rem # Disabling DWM borks admin rights
rem # Renaming dwmapi.dll freezes system after boot
rem # https://youtu.be/K_4i6X5OAw8
rem # https://youtu.be/1iXfUThaQ1Q
rem # https://youtu.be/j6_GXujgM3Y
rem # SystemApps REQUIRES WINRE ENVIRONMENT
rem # CLASSIC THEME MUST BE ENABLED OR GAMES RUN SLOW WHEN DWM IS DISABLED
rem # Launch SetACL.bat to take ownership of reg keys
cd "%~dp0"
ECHO R | powershell.exe ./SetACL.bat
cd "%USERPROFILE%\Downloads"
cd "%USERPROFILE%\Downloads\windows11-scripts-main"
ECHO R | powershell.exe ./SetACL.bat
cd "%USERPROFILE%\Downloads"
cd "%USERPROFILE%\Downloads\windows11-scripts-main\windows11-scripts-main"
ECHO R | powershell.exe ./SetACL.bat
cd "%USERPROFILE%\Downloads"
cd "%USERPROFILE%\Downloads\windows11-scripts\windows11-scripts"
ECHO R | powershell.exe ./SetACL.bat
cd "%USERPROFILE%\Downloads"
cd "%USERPROFILE%\Downloads\windows11-scripts"
ECHO R | powershell.exe ./SetACL.bat
cd "%USERPROFILE%\Downloads"
TIMEOUT /T 5
rem # Backup dwm.exe (to restore run "sfc /scannow")
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwm.exe"
icacls "C:\Windows\System32\dwm.exe" /grant:r %username%:F
rem taskkill /im dwm.exe /f
rem del "C:\Windows\System32\dwm.exe" /s /f /q
ren "C:\Windows\System32\dwm.exe" "dwm.exe.bak"
copy "C:\Windows\System32\cmd.exe" "C:\Windows\System32\dwm.exe"
call SystemApps.bat
call ClassicTheme.bat
rem # Fix Black Screen at Login
takeown /s %computername% /u %username% /f "C:\Windows\System32\Windows.UI.logon.dll"
icacls "C:\Windows\System32\Windows.UI.logon.dll" /grant:r %username%:F
rem taskkill /im Windows.UI.logon.dll /f
rem del "C:\Windows\System32\Windows.UI.logon.dll" /s /f /q
ren "C:\Windows\System32\Windows.UI.logon.dll" "Windows.UI.logon.dll.bak"
rem # Fix Mouse
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwminit.dll"
icacls "C:\Windows\System32\dwminit.dll" /grant:r %username%:F
rem taskkill /im dwminit.dll /f
rem del "C:\Windows\System32\dwminit.dll" /s /f /q
ren "C:\Windows\System32\dwminit.dll" "dwminit.dll.bak"
@echo off
echo.
echo Shell Infrastructure Host (sihost.exe)
echo.
echo 1. Disable Shell Infrastructure Host (sihost.exe) (SLOW SYSTEM)
echo 2. Enable Shell Infrastructure Host (sihost.exe) (RECOMMENDED)
echo 3. SKIP
echo C. Cancel
echo.
choice /c 123C /m "Choose an option :"
if 4 EQU %ERRORLEVEL% (
echo User chose to cancel.
) else if 3 EQU %ERRORLEVEL% (
call :zkepppp
) else if 2 EQU %ERRORLEVEL% (
call :sion
) else if 1 EQU %ERRORLEVEL% (
call :sioff
) else if 0 EQU %ERRORLEVEL% (
echo User bailed out.
)
goto :eof
:sioff
echo User chose Disable Shell Infrastructure Host (sihost.exe) (SLOW SYSTEM)
cd "%~dp0"
call DisableShellInfrastructureHost.bat
goto :end
:sion
echo User chose Enable Shell Infrastructure Host (sihost.exe) (RECOMMENDED)
cd "%~dp0"
call EnableShellInfrastructureHost.bat
goto :end
:zkepppp
echo User chose SKIP
goto :end
:end
echo.
echo DWM DLLs
echo.
echo 1. Disable DWM DLLs
echo 2. Enable DWM DLLs
echo 3. SKIP
echo C. Cancel
echo.
choice /c 123C /m "Choose an option :"
if 4 EQU %ERRORLEVEL% (
echo User chose to cancel.
) else if 3 EQU %ERRORLEVEL% (
call :zkeppppp
) else if 2 EQU %ERRORLEVEL% (
call :dllon
) else if 1 EQU %ERRORLEVEL% (
call :dlloff
) else if 0 EQU %ERRORLEVEL% (
echo User bailed out.
)
goto :eof
:dlloff
echo User chose Disable DWM DLLs
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmapi.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmcore.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmghost.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmredir.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmscene.dll"
icacls "C:\Windows\System32\dwmapi.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmcore.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmghost.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmredir.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmscene.dll" /grant:r %username%:F
rem # FREEZES SYSTEM AFTER BOOT
rem ren "C:\Windows\System32\dwmapi.dll" "dwmapi.dll.bak"
ren "C:\Windows\System32\dwmcore.dll" "dwmcore.dll.bak"
ren "C:\Windows\System32\dwmghost.dll" "dwmghost.dll.bak"
ren "C:\Windows\System32\dwmredir.dll" "dwmredir.dll.bak"
ren "C:\Windows\System32\dwmscene.dll" "dwmscene.dll.bak"
goto :end
:dllon
echo User chose Enable DWM DLLs
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmapi.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmcore.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmghost.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmredir.dll"
takeown /s %computername% /u %username% /f "C:\Windows\System32\dwmscene.dll"
icacls "C:\Windows\System32\dwmapi.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmcore.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmghost.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmredir.dll" /grant:r %username%:F
icacls "C:\Windows\System32\dwmscene.dll" /grant:r %username%:F
rem # FREEZES SYSTEM AFTER BOOT
ren "C:\Windows\System32\dwmapi.dll.bak" "dwmapi.dll"
ren "C:\Windows\System32\dwmcore.dll.bak" "dwmcore.dll"
ren "C:\Windows\System32\dwmghost.dll.bak" "dwmghost.dll"
ren "C:\Windows\System32\dwmredir.dll.bak" "dwmredir.dll"
ren "C:\Windows\System32\dwmscene.dll.bak" "dwmscene.dll"
goto :end
:zkeppppp
echo User chose SKIP
goto :end
:end
PAUSE
rem # Disabling dwminit.dll is required when using DWM and disabling "Windows\Resources" or screen flickers then turns black
rem # DWM: OFF / sihost: OFF / Resources: OFF / SystemApps: ON = GAME CRASH / VERY SLOW
rem # DWM: OFF / sihost: ON / Resources: OFF / SystemApps: ON = SYSTEM BROKEN
rem # DWM: OFF / sihost: OFF / Resources: OFF / SystemApps: OFF = GAME CRASH / VERY SLOW
rem # DWM: OFF / sihost: ON / Resources: OFF / SystemApps: OFF = WORKS (GAME BROKEN ON VANILLA SYSTEM)
rem # DWM: ON / sihost: ON / Resources: OFF / SystemApps: OFF = SYSTEM BROKEN
rem # DWM: ON / sihost: OFF / Resources: OFF / SystemApps: OFF = SYSTEM BROKEN
rem # DWM: ON / sihost: OFF / Resources: ON / SystemApps: OFF = WORKS
rem # DWM: ON / sihost: ON / Resources: ON / SystemApps: OFF = WORKS