タグ
  ANSI (1)
  ASP.NET (10)
  Active Directory (55)
  BAT (16)
  Backup (2)
  CSharp (11)
  CentOS (4)
  C言語 (4)
  DNS (4)
  Excel (3)
  FFmpeg (1)
  Fedora (4)
  FreeBSD (6)
  IPv6 (3)
  Java (11)
  JavaScript (8)
  LAN (1)
  Link (4)
  Linux (15)
  Mac (1)
  Mail (2)
  Microsoft (3)
  NIS (1)
  Node.js (6)
  OpenIndiana (1)
  OpenLDAP (2)
  OpenSSL (1)
  OpenSolaris (4)
  PHP (2)
  Perl (2)
  Postfix (1)
  PostgreSQL (2)
  PowerShell (34)
  RFC (3)
  SQL Server (5)
  Solaris (10)
  Ubuntu (9)
  VBScript (73)
  VCpp (2)
  VMware (3)
  Visual Basic (1)
  WMI (17)
  WSF (5)
  WSH (10)
  Windows (19)
  bash (1)
  bind (1)
  iSCSI (1)
  おまけ (3)
  作成中 (8)
  慣用句 (3)
  正規表現 (6)
  運用 (8)
作成 2010.01.08
更新 2010.10.27
VBScript でレジストリの操作
コード

このサンプルではregStrで指定したレジストリ値を操作します。

Option Explicit
Dim regStr, WshShell
regStr = "HKCU\..."
Set WshShell = CreateObject("WScript.Shell")
WScript.Echo WshShell.RegRead(regStr)
WScript.Echo WshShell.RegWrite(regStr, 1, "REG_DWORD")
WScript.Echo WshShell.RegWrite(regStr, 1, "REG_BINARY")
WScript.Echo WshShell.RegWrite(regStr, "aaa", "REG_SZ")
WScript.Echo WshShell.RegDelete(regStr)
レジストリの省略表現
省略キー レジストリ
HKCU HKEY_CURRENT_USER
HKLM HKEY_LOCAL_MACHINE
HKCR HKEY_CLASSES_ROOT
HKU HKEY_USERS
HKCC HKEY_CURRENT_CONFIG
RegWrite メソッドのデータ型
データ型 内容
REG_SZ 文字列
REG_EXPAND_SZ 展開可能な文字列。環境変数などが入れられる
REG_DWORD 整数
REG_BINARY 2進数の整数。取得時は文字列になる
参照

RegRead メソッド | RegWrite メソッド | RegDelete メソッド

タグ: VBScript WSH
[リロード] [記事修正] [新規作成] [使用方法]
©2004-2012 UPKEN IPv4