File tree Expand file tree Collapse file tree
AtlasDesktop/3. General Configuration/Search Indexing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ set "stateValue=0"
44set " scriptPath = %~f0 "
55set indexConfPath = " %windir% \AtlasModules\Scripts\indexConf.cmd"
66set " silentMode = 0"
7-
8- echo %* | findstr /i /c:" /silent" /c:" -silent" /c:" /quiet" > nul 2 >& 1 && set " silentMode = 1"
7+ for %%a in (%* ) do (
8+ if /I " %%a " == " /silent" set " silentMode = 1"
9+ if /I " %%a " == " -silent" set " silentMode = 1"
10+ if /I " %%a " == " /quiet" set " silentMode = 1"
11+ )
912
1013if " %silentMode% " == " 1" (
1114 fltmc > nul 2 >& 1 || (
@@ -20,8 +23,10 @@ if "%silentMode%"=="1" (
2023)
2124
2225if not exist " %indexConfPath% " (
23- echo The 'indexConf.cmd' script wasn't found in AtlasModules.
24- pause
26+ if " %silentMode% " == " 0" (
27+ echo The 'indexConf.cmd' script wasn't found in AtlasModules.
28+ pause
29+ )
2530 exit /b 1
2631)
2732set " indexConf = call %indexConfPath% "
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ set "stateValue=2"
44set " scriptPath = %~f0 "
55set indexConfPath = " %windir% \AtlasModules\Scripts\indexConf.cmd"
66set " silentMode = 0"
7-
8- echo %* | findstr /i /c:" /silent" /c:" -silent" /c:" /quiet" > nul 2 >& 1 && set " silentMode = 1"
7+ for %%a in (%* ) do (
8+ if /I " %%a " == " /silent" set " silentMode = 1"
9+ if /I " %%a " == " -silent" set " silentMode = 1"
10+ if /I " %%a " == " /quiet" set " silentMode = 1"
11+ )
912
1013if " %silentMode% " == " 1" (
1114 fltmc > nul 2 >& 1 || (
@@ -20,8 +23,10 @@ if "%silentMode%"=="1" (
2023)
2124
2225if not exist " %indexConfPath% " (
23- echo The 'indexConf.cmd' script wasn't found in AtlasModules.
24- pause
26+ if " %silentMode% " == " 0" (
27+ echo The 'indexConf.cmd' script wasn't found in AtlasModules.
28+ pause
29+ )
2530 exit /b 1
2631)
2732set " indexConf = call %indexConfPath% "
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ set "stateValue=1"
44set " scriptPath = %~f0 "
55set indexConfPath = " %windir% \AtlasModules\Scripts\indexConf.cmd"
66set " silentMode = 0"
7-
8- echo %* | findstr /i /c:" /silent" /c:" -silent" /c:" /quiet" > nul 2 >& 1 && set " silentMode = 1"
7+ for %%a in (%* ) do (
8+ if /I " %%a " == " /silent" set " silentMode = 1"
9+ if /I " %%a " == " -silent" set " silentMode = 1"
10+ if /I " %%a " == " /quiet" set " silentMode = 1"
11+ )
912
1013if " %silentMode% " == " 1" (
1114 fltmc > nul 2 >& 1 || (
@@ -20,9 +23,10 @@ if "%silentMode%"=="1" (
2023)
2124
2225if not exist " %indexConfPath% " (
23- echo The 'indexConf.cmd' script wasn't found in AtlasModules.
24- if " %silentMode% " == " 1" exit /b 1
25- pause
26+ if " %silentMode% " == " 0" (
27+ echo The 'indexConf.cmd' script wasn't found in AtlasModules.
28+ pause
29+ )
2630 exit /b 1
2731)
2832set " indexConf = call %indexConfPath% "
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ if "%~1"=="/start" (
3838 %___settings% /unhide cortana-windowssearch
3939
4040 echo Updating policy... ^ (this might take a moment^ )
41- gpupdate > nul
41+ gpupdate /force /wait:0 > nul 2 >& 1
4242)
4343
4444if " %~1 " == " /stop" (
@@ -47,7 +47,7 @@ if "%~1"=="/stop" (
4747 %___settings% /hide cortana-windowssearch
4848
4949 rem Kill the search index Control Panel pane
50- powershell -NoP -NonI -C " Stop -Process -Id (gcim Win32_Process | ? { $_.CommandLine -match 'srchadmin.dll' }).ProcessId - Force"
50+ powershell -NoP -NonI -C " Get -Process | Where-Object { $_.MainWindowTitle -like '*Indexing Options*' -or $_.CommandLine -match 'srchadmin.dll' } | Stop-Process - Force -ErrorAction SilentlyContinue "
5151
5252 sc config WSearch start=disabled > nul
5353 sc stop WSearch > nul 2 >& 1
You can’t perform that action at this time.
0 commit comments