Notice: Constant SAVEQUERIES already defined in /home/uwsc/domains/uwsc.jp/public_html/wp-config.php on line 125

Notice: 関数 wp_add_inline_script が誤って呼び出されました。<script> タグを wp_add_inline_script() に渡さないでください。 詳しくは WordPress のデバッグをご覧ください。 (このメッセージはバージョン 4.5.0 で追加されました) in /home/uwsc/domains/uwsc.jp/public_html/wp-includes/functions.php on line 5905

Notice: Undefined variable: post in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 147

Notice: Undefined variable: post in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 154

Notice: Trying to get property 'ID' of non-object in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 154

Notice: Undefined index: description in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 200

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 200
WshShell.RegWrite メソッド | UWSC辞典


Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 27

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 31
WshShell.RegWrite メソッド

本ページには広告が含まれています。


Notice: Undefined offset: 1 in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 154

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 13

Notice: Undefined variable: id in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 61

Notice: Trying to access array offset on value of type null in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 27

Warning: in_array() expects parameter 2 to be array, null given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Notice: Undefined variable: html in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 23

Warning: in_array() expects parameter 2 to be array, null given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Notice: Undefined variable: html in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 23

Warning: in_array() expects parameter 2 to be array, null given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Notice: Undefined variable: html in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 23

Warning: in_array() expects parameter 2 to be array, null given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Notice: Undefined variable: html in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 23

Warning: in_array() expects parameter 2 to be array, null given in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 41

Notice: Undefined variable: html in /home/uwsc/domains/uwsc.jp/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()'d code on line 23

新しいキーの作成、新しい値名の既存キーへの追加(および値の設定)、既存の値名の値変更などを行います。

構文
WshShell.RegWrite( strName, anyValue, strType )
引数
strName 省略可
作成、追加、変更するキー名、値名、または値を示す文字列値
anyValue 省略可
作成するキーの名前、既存のキーに追加する値の名前、または既存の値名に設定する値
strType 省略可
レジストリに保存する値のデータ型
戻り値

strName

正式キー名 短縮キー名
HKEY_CLASSES_ROOT HKCR
HKEY_CURRENT_USER HKCU
HKEY_LOCAL_MACHINE HKLM
HKYE_USERS HKU(利用不可)
HKEY_CURRENT_CONFIG HKCC(利用不可)

strType

データ型 定数
文字列値 REG_SZ
バイナリ値 REG_BINARY
DWORD(32ビット)値 REG_DWORD
QWORD(64ビット)値 REG_QWORD
複数行文字列値 REG_MULTI_SZ
展開可能な文字列値 REG_EXPAND_SZ

プログラム実行例

タスクバーにある時計に秒を表示する

PC再起動後に適用されます。

UWSC
DIM WshShell = CREATEOLEOBJ("WScript.Shell")

DIM name = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSecondsInSystemClock"
DIM value = 1
DIM type = "REG_DWORD"

WshShell.RegWrite(name, value, type)

//DOSCMD("shutdown /r /t 0")
使用関数

タスクバーにある時計の秒を非表示にする

PC再起動後に適用されます。

UWSC
DIM WshShell = CREATEOLEOBJ("WScript.Shell")

DIM name = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSecondsInSystemClock"
DIM value = 0
DIM type = "REG_DWORD"

WshShell.RegWrite(name, value, type)

//DOSCMD("shutdown /r /t 0")
使用関数

Internet ExplorerからMicrosoft Edgeにリダイレクトされるのを無効化

UWSC
DIM WshShell = CREATEOLEOBJ("WScript.Shell")

DIM name = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\TabProcGrowth"
DIM value = 0
DIM type = "REG_DWORD"

WshShell.RegWrite(name, value, type)
結果
TabProcGrowth.png
使用関数

デスクトップのアイコン名に影を付ける

パフォーマンス-視覚効果のパフォーマンスオプションの「デスクトップのアイコン名に影を付ける」をオンにします。

UWSC
DIM WshShell = CREATEOLEOBJ("WScript.Shell")

DIM name = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ListviewShadow"
DIM value = 1
DIM type = "REG_DWORD"

WshShell.RegWrite(name, value, type)
使用関数

デスクトップのアイコン名に影を付けない

パフォーマンス-視覚効果のパフォーマンスオプションの「デスクトップのアイコン名に影を付ける」をオフにします。

UWSC
DIM WshShell = CREATEOLEOBJ("WScript.Shell")

DIM name = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ListviewShadow"
DIM value = 0
DIM type = "REG_DWORD"

WshShell.RegWrite(name, value, type)
使用関数