Skip to content

Commit a0e8310

Browse files
authored
(#491) Add disable / enable taskbar search box (#492)
* (#491) Add disable / enable taskbar search box * (#491) Update doc examples
1 parent 8834e83 commit a0e8310

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1

+19-1
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,18 @@ multi-monitor support and always combine icons on non-primary monitors.
112112
[Parameter(ParameterSetName='MultiMonitorOn')]
113113
[ValidateSet('Always','Full','Never')]
114114
[String]
115-
$MultiMonitorCombine
115+
$MultiMonitorCombine,
116+
117+
[Parameter(ParameterSetName = 'DisableSearchBox')]
118+
[switch]
119+
$DisableSearchBox,
120+
121+
[Parameter(ParameterSetName = 'EnableSearchBox')]
122+
[switch]
123+
$EnableSearchBox
116124
)
117125

126+
$baseKey = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion'
118127
$explorerKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer'
119128
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
120129
$settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2'
@@ -236,6 +245,15 @@ multi-monitor support and always combine icons on non-primary monitors.
236245
}
237246
}
238247

248+
if ($EnableSearchBox.IsPresent) {
249+
# this will create the path if it doesn't exist
250+
Set-ItemProperty -Path (Join-Path -Path $baseKey -ChildPath 'Search') -Name 'SearchBoxTaskbarMode' -Value 2 -Type DWord -Force
251+
}
252+
elseif ($DisableSearchBox.IsPresent) {
253+
# this will create the path if it does not exist
254+
Set-ItemProperty -Path (Join-Path -Path $baseKey -ChildPath 'Search') -Name 'SearchBoxTaskbarMode' -Value 0 -Type DWord -Force
255+
}
256+
239257
Restart-Explorer
240258
}
241259

Web/WinConfig.cshtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProt
7878
<p>Sets options on the Windows Taskbar (formerly called Set-TaskbarOptions)</p>
7979
<p>AlwaysShowIconsOn/AlwaysShowIconsOff allows turning on or off always showing all icons in the notification area.</p>
8080
<pre>
81-
Set-BoxstarterTaskbarOptions -Size Small -Dock Top -Combine Always -AlwaysShowIconsOn -MultiMonitorOn -MultiMonitorMode All -MultiMonitorCombine Always
81+
Set-BoxstarterTaskbarOptions -Size Small -Dock Top -Combine Always -AlwaysShowIconsOn -MultiMonitorOn -MultiMonitorMode All -MultiMonitorCombine Always -EnableSearchBox
8282
</pre>
8383
<p>It is also possible to do the converse actions, if required.</p>
8484
<pre>
85-
Set-BoxstarterTaskbarOptions -Size Large -Dock Bottom -Combine Never -AlwaysShowIconsOff -MultiMonitorOff
85+
Set-BoxstarterTaskbarOptions -Size Large -Dock Bottom -Combine Never -AlwaysShowIconsOff -MultiMonitorOff -DisableSearchBox
8686
</pre>
8787

8888
<h3>Update-ExecutionPolicy</h3>

0 commit comments

Comments
 (0)