-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisableSuperFetch.bat
111 lines (85 loc) · 2.98 KB
/
disableSuperFetch.bat
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
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Disable pre/super fetch ::
:: ::
:: 0: SuperFetch Prefetch deaktiviert ::
:: 1: Beschleunigt den Start von Programmen ::
:: 2: Der Bootvorgang wird beschleunigt ::
:: 3: Beides (Bootvorgang und das Starten von Programmen) wird beschleunigt ::
:: ::
:: files ::
:: C:\Windows\Prefetch ::
:: ::
:: Version: 1.1.0 ::
:: Last changed: 14.06.2022 ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo off
setlocal
set my_name=%~n0
set my_dir="%~dp0"
set /a chk=0
set /a val=0
set /a verbose=0
if [%1]==[] goto main
GOTO :ParseParams
:ParseParams
if [%1]==[/?] goto help
if [%1]==[/h] goto help
if [%1]==[/help] goto help
IF /i "%~1"=="/c" (
SET /a chk=1
goto reParseParams
)
IF /i "%~1"=="/check" (
SET /a chk=1
goto reParseParams
)
IF /i "%~1"=="/d" (
SET /a val=%2
SHIFT
goto reParseParams
)
IF /i "%~1"=="/data" (
SET /a val=%2
SHIFT
goto reParseParams
)
IF /i "%~1"=="/v" (
SET /a verbose=1
goto reParseParams
) ELSE (
echo Unknown option : "%~1"
)
:reParseParams
SHIFT
if [%1]==[] goto main
GOTO :ParseParams
:main
set "prefetch_parameters=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters"
if %chk% == 0 (
if %verbose% == 1 (
echo setting "EnablePrefetcher" to %val%
)
reg add "%prefetch_parameters%" /v EnablePrefetcher /t REG_DWORD /d %val% /f
:: doesn't exist for SSDs
if %verbose% == 1 (
echo setting "EnableSuperfetch" to %val%
)
reg add "%prefetch_parameters%" /v EnableSuperfetch /t reg_dword /d %val% /f
) else (
reg query "%prefetch_parameters%"
)
:: files
:: C:\Windows\Prefetch
endlocal
exit /b %errorlevel%
:usage
echo Usage: %my_name% [/d ^<value^>] [/c] [/v]
exit /B 0
:help
call :usage
echo.
echo Options:
echo /d Set registry values to this number. Default: 0 = disable.
echo /c Check registry entry.
echo /v Verbose mode
exit /B 0