Skip to content

Instantly share code, notes, and snippets.

@eyasuyuki
Created February 6, 2025 01:10
Show Gist options
  • Save eyasuyuki/bb36d0a84d37ba42376cb81b263f0815 to your computer and use it in GitHub Desktop.
Save eyasuyuki/bb36d0a84d37ba42376cb81b263f0815 to your computer and use it in GitHub Desktop.
Windows 11でタスクバーを上に表示させるJScript
var WshShell = new ActiveXObject("WScript.Shell");
var regPath = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StuckRects3";
var value = "00000000 00000000 03000000 00ffffff ffffffff ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000";
try {
// レジストリに新しい値を書き込む
WshShell.RegWrite(regPath, value, "REG_BINARY");
// エクスプローラーを再起動
WshShell.Run("taskkill /F /IM explorer.exe", 0, true);
WshShell.Run("explorer.exe", 0, false);
WScript.Echo("タスクバーを上部に移動しました。");
} catch (e) {
WScript.Echo("エラー: " + e.message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment