đź“„ JScript (WSH)

Enable Dark Mode (JScript)

Switches File Explorer and other system surfaces to dark mode. Applies the tweak via WScript.Shell.RegWrite (JScript syntax).

By WindowsScripting.com · 590 B
SetDarkMode.js
// ============================================================
// SetDarkMode.js
//
// Enable Dark Mode.
// Switches File Explorer and other system surfaces to dark mode.
//
// Usage: cscript SetDarkMode.js
// ============================================================

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

try {
    objShell.RegWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize\\AppsUseLightTheme", 0, "REG_DWORD");
    WScript.Echo("Enable Dark Mode applied.");
} catch (e) {
    WScript.Echo("Failed to apply tweak: " + e.description);
}