Skip to content

Commit 0f9813b

Browse files
authored
Update Enable-AutoTray.ps1
1 parent 775cc7f commit 0f9813b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Scripts/Others/Enable-AutoTray.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
function W10_TrayNotify {
22
Set-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer EnableAutoTray 0
3-
ps explorer | kill
3+
Get-Process explorer | Stop-Process -Force
44
}
55

66
function W11_TrayNotify {
77
foreach ($GUID in (Get-ChildItem -Path 'HKCU:\Control Panel\NotifyIconSettings' -Name)) {
88
$ChildPath = "HKCU:\Control Panel\NotifyIconSettings\$($GUID)"
9-
$Exec = (Get-ItemProperty -Path $ChildPath -Name ExecutablePath -ErrorAction SilentlyContinue).ExecutablePath
109
Set-ItemProperty -Path $ChildPath -Name IsPromoted -Value 1
1110
}
1211
}

0 commit comments

Comments
 (0)