⚡ PowerShell 5.1+

Show This PC Icon on Desktop

Adds the This PC icon back to the desktop.

By WindowsScripting.com · 788 B
Set-ShowThisPCOnDesktop.ps1
<#
.SYNOPSIS
    Show This PC Icon on Desktop.

.DESCRIPTION
    Adds the This PC icon back to the desktop.

    Sets HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel \ {20D04FE0-3AEA-1069-A2D8-08002B30309D} to 0.

.EXAMPLE
    .\Set-ShowThisPCOnDesktop.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel'

if (-not (Test-Path $regPath)) {
    New-Item -Path $regPath -Force | Out-Null
}

New-ItemProperty -Path $regPath -Name '{20D04FE0-3AEA-1069-A2D8-08002B30309D}' -Value 0 -PropertyType DWord -Force | Out-Null

Write-Host "Show This PC Icon on Desktop applied. Sign out and back in (or restart explorer.exe) for it to fully take effect." -ForegroundColor Green