我在網上搜索,實際發現這是隨機的。
長話短說,PowerShell(腳本提供)和GPO的組合。
http://4sysops.com/archives/forcing-notification-area-icons-to-always-show-in-windows-7-or-windows-8/
長的故事,創造一個PowerShell腳本包含以下內容:
param(
[Parameter(Mandatory=$true,HelpMessage='The name of the program')][string]$ProgramName,
[Parameter(Mandatory=$true,HelpMessage='The setting (2 = show icon and notifications 1 = hide icon and notifications, 0 = only show notifications')]
[ValidateScript({if ($_ -lt 0 -or $_ -gt 2) { throw 'Invalid setting' } return $true})]
[Int16]$Setting
)
$encText = New-Object System.Text.UTF8Encoding
[byte[]] $bytRegKey = @()
$strRegKey = ""
$bytRegKey = $(Get-ItemProperty $(Get-Item 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify').PSPath).IconStreams
for($x=0; $x -le $bytRegKey.Count; $x++)
{
$tempString = [Convert]::ToString($bytRegKey[$x], 16)
switch($tempString.Length)
{
0 {$strRegKey += "00"}
1 {$strRegKey += "0" + $tempString}
2 {$strRegKey += $tempString}
}
}
[byte[]] $bytTempAppPath = @()
$bytTempAppPath = $encText.GetBytes($ProgramName)
[byte[]] $bytAppPath = @()
$strAppPath = ""
Function Rot13($byteToRot)
{
if($byteToRot -gt 64 -and $byteToRot -lt 91)
{
$bytRot = $($($byteToRot - 64 + 13) % 26 + 64)
return $bytRot
}
elseif($byteToRot -gt 96 -and $byteToRot -lt 123)
{
$bytRot = $($($byteToRot - 96 + 13) % 26 + 96)
return $bytRot
}
else
{
return $byteToRot
}
}
for($x = 0; $x -lt $bytTempAppPath.Count * 2; $x++)
{
If($x % 2 -eq 0)
{
$curbyte = $bytTempAppPath[$([Int]($x/2))]
$bytAppPath += Rot13($curbyte)
}
Else
{
$bytAppPath += 0
}
}
for($x=0; $x -lt $bytAppPath.Count; $x++)
{
$tempString = [Convert]::ToString($bytAppPath[$x], 16)
switch($tempString.Length)
{
0 {$strAppPath += "00"}
1 {$strAppPath += "0" + $tempString}
2 {$strAppPath += $tempString}
}
}
if(-not $strRegKey.Contains($strAppPath))
{
Write-Host Program not found. Programs are case sensitive.
break
}
[byte[]] $header = @()
$items = @{}
for($x=0; $x -lt 20; $x++)
{
$header += $bytRegKey[$x]
}
for($x=0; $x -lt $(($bytRegKey.Count-20)/1640); $x++)
{
[byte[]] [email protected]()
$startingByte = 20 + ($x*1640)
$item += $bytRegKey[$($startingByte)..$($startingByte+1639)]
$items.Add($startingByte.ToString(), $item)
}
foreach($key in $items.Keys)
{
$item = $items[$key]
$strItem = ""
$tempString = ""
for($x=0; $x -le $item.Count; $x++)
{
$tempString = [Convert]::ToString($item[$x], 16)
switch($tempString.Length)
{
0 {$strItem += "00"}
1 {$strItem += "0" + $tempString}
2 {$strItem += $tempString}
}
}
if($strItem.Contains($strAppPath))
{
Write-Host Item Found with $ProgramName in item starting with byte $key
$bytRegKey[$([Convert]::ToInt32($key)+528)] = $setting
Set-ItemProperty $($(Get-Item 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify').PSPath) -name IconStreams -value $bytRegKey
}
}
保存爲使用您所選擇的名稱PS1文件。
打開組策略管理MMC。選擇您選擇的組策略對象,右鍵單擊並選擇編輯。在編輯器中,導航至用戶配置> Windows設置>腳本>登錄,然後單擊「顯示屬性」。轉到PowerShell選項卡並單擊查看文件。
將您剛剛創建的腳本複製到剛剛打開的資源管理器窗口中,然後關閉窗口。
在登錄腳本屬性窗口中添加一個新的PowerShell腳本,在腳本名稱中輸入您使用的腳本的名稱(例如:NotifyIcon.ps1),然後在參數中輸入程序名稱(大小寫!其次是設置敏感)使用方法:
0 =僅顯示通知1 =隱藏圖標和通知2 =顯示圖標和通知< ---你需要
例如,如果你需要的RealVNC的一個服務器總是出現,你會輸入:
winvnc4.exe 2
爲paramenters
你可以找到在幾個不同的方式,比如打開運行對話框並鍵入MSCONFIG,然後看着啓動程序,手動導航到安裝目錄C可執行文件的名稱:\ Program Files {您的程序},或嘗試通過查看任務管理器中正在運行的進程來匹配所需的程序。 10次中有9次會導致成功。
爲了使其工作,用戶必須先運行應用程序,然後正確註銷,以便explorer.exe有機會將更新的通知區域歷史記錄寫入註冊表。在後續登錄時,腳本應該成功在歷史記錄中找到該程序,並將其設置更新爲始終顯示。
您也可以嘗試從PowerShell提示符手動運行腳本進行調試,但在運行之前必須先殺死explorer.exe('taskkill/f/im explorer.exe'),否則explorer將不會看到您的更新,並在退出時覆蓋它。
我對這個過程沒有評價。我沒有寫,我只是找到它。對劇本的信貸轉交給Micah Rowland。 GPO流程的積分轉到傑夫肯德爾
沒有足夠的聲望鏈接到原作者,除了頂部的那個。
通知區域圖標「始終可見」狀態是通過任務欄屬性對話框進行的用戶選擇。如果Windows公開了編程接口,我也會感到驚訝。 – Jon
是的,通常我不會試圖強制它到用戶。但是他們製作的屏幕截圖並非被不活動的圖標窗口所覆蓋,這一點至關重要。 – Drake
然後他們可以進入「自定義...」,並說他們希望這個圖標始終可見。 –