달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

' 키 및 문자열 값 입력/업데이트
Set oArgs = WScript.Arguments

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\<Key Name>"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

strValueName = "<Sting Value Name>"
strValue = oArgs(0)

oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue



' 문자열 값 쿼리
const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\<Key Name>"
strValueName = "<String Value Name 1>"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue1

strValueName = "<String Value Name 2>"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue2

If IsNull(strValue1) OR IsNull(strValue2) Then
WScript.Quit
End If

WScript.Echo strValue1
WScript.Echo strValue2

:
Posted by 커널64