LoginSignup
7
7

More than 5 years have passed since last update.

Windowsレジストリ変更を.bat(バッチ)で行った時のメモ

Last updated at Posted at 2019-01-06

レジストリ変更を.batファイルで行いたかったが、REG_BINARY形式のデータ変更書式で詰まったので解決メモ。

下記は間違った記述

reg add HKEY_CURRENT_USER¥Software¥Microsoft¥Windows¥CurrentVersion¥Explorer /v ShellState /t REG_BINARY /d hex:24,00,00,00,33,a0,00,00,00,00,00,00,00,00,00,00,00,¥ 00,00,00,01,00,00,00,12,00,00,00,00,00,00,00,32,00,00,00 /f

下記は正しい記述

reg add HKEY_CURRENT_USER¥Software¥Microsoft¥Windows¥¥CurrentVersion¥Explorer /v ShellState /t REG_BINARY /d 2400000033a0000000000000000000000000000001000000120000000000000032000000 /f

まとめ

reg add .... /dまでは一緒。
そこから後はhex:とか,(カンマ)とか¥(改行)とかは不要。数値だけを羅列するのが正解。

その他注意したところ

例えばControl Panelというディレクトリなど、ディレクトリに空白が入る場合は、ディレクトリの記述全体を"(ダブルクォーテーション)で囲めば良し。

reg add "HKEY_CURRENT_USER¥Software¥Control Panel¥CurrentVersion¥Explorer" /v Example /d 1 /f

7
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7