đź“„ JScript (WSH)

Show This PC Icon on Desktop (JScript)

Adds the This PC icon back to the desktop. Applies the tweak via WScript.Shell.RegWrite (JScript syntax).

By WindowsScripting.com · 659 B
SetShowThisPCOnDesktop.js
// ============================================================
// SetShowThisPCOnDesktop.js
//
// Show This PC Icon on Desktop.
// Adds the This PC icon back to the desktop.
//
// Usage: cscript SetShowThisPCOnDesktop.js
// ============================================================

var objShell = WScript.CreateObject("WScript.Shell");

try {
    objShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 0, "REG_DWORD");
    WScript.Echo("Show This PC Icon on Desktop applied.");
} catch (e) {
    WScript.Echo("Failed to apply tweak: " + e.description);
}