I am playing around with powershell and am changing some taskbar settings by changing the registry key. For example i have written an autohide enable disable function.
$autoHideSettingsPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2";
$autoHideValueName = "Settings";
Function toggleAutohideRegistrySettings($enable)
{
$key = Get-ItemProperty -Path $autoHideSettingsPath -Name $autoHideValueName;
Write-Host "key is: " + $key
if($enable)
{
$key.$autoHIdeValueName[8] = $key.$autoHideValueName[8] -bor 1;
}else{
$key.$autoHIdeValueName[8] = $key.$autoHideValueName[8] -band 0;
}
Set-ItemProperty -Path $autoHideSettingsPath -Name $autoHideValueName -Value $key.$autoHideValueName;
}
The change in registry works perfectly. But to take effect i need to restart the explorer.exe. Which i can obviously also do in PS... but i noticed that when you apply the autohide settings in the menue (the mouse way), the explorer.exe is not being restarted.
So my question is: how do i apply the changes to the taskbar in the PS, without restarting the explorer.exe?