-
-
Notifications
You must be signed in to change notification settings - Fork 706
Expand file tree
/
Copy pathMinimal Search Indexing (default).cmd
More file actions
54 lines (45 loc) · 1.53 KB
/
Minimal Search Indexing (default).cmd
File metadata and controls
54 lines (45 loc) · 1.53 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
@echo off
set "settingName=Indexing"
set "stateValue=1"
set "scriptPath=%~f0"
set indexConfPath="%windir%\AtlasModules\Scripts\indexConf.cmd"
set "silentMode=0"
echo %* | findstr /i /c:"/silent" /c:"-silent" /c:"/quiet" > nul 2>&1 && set "silentMode=1"
if "%silentMode%"=="1" (
fltmc > nul 2>&1 || (
call RunAsTI.cmd "%~f0" %*
exit /b
)
) else (
whoami /user | find /i "S-1-5-18" > nul 2>&1 || (
call RunAsTI.cmd "%~f0" %*
exit /b
)
)
if not exist "%indexConfPath%" (
echo The 'indexConf.cmd' script wasn't found in AtlasModules.
if "%silentMode%"=="1" exit /b 1
pause
exit /b 1
)
set "indexConf=call %indexConfPath%"
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul
if "%silentMode%"=="0" (
echo.
echo Configuring minimal search indexing...
)
%indexConf% /stop
%indexConf% /cleanpolicies
%indexConf% /include "%programdata%\Microsoft\Windows\Start Menu\Programs"
%indexConf% /include "%windir%\AtlasDesktop"
%indexConf% /exclude "%systemdrive%\Users"
reg add "HKLM\Software\Microsoft\Windows Search\Gather\Windows\SystemIndex" /v "RespectPowerModes" /t REG_DWORD /d 1 /f > nul
%indexConf% /start
reg add "HKLM\SOFTWARE\Microsoft\Windows Search" /v SetupCompletedSuccessfully /t REG_DWORD /d 0 /f > nul
if "%silentMode%"=="1" exit /b
echo.
echo Minimal Search Indexing has been configured.
echo Press any key to exit...
pause
exit /b