On Error Resume Next
strKeyPath = "SOFTWARE\Microsoft\Windows Script Host\Settings" 'give reg path
strValueName = "TrustPolicy" 'give key to get
strComputer = "."
Const HKEY_LOCAL_MACHINE = &H80000002
dim shell
set shell=createobject("wscript.shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'WScript.Echo "strvalue" & strvalue
shell.run "test.bat " & strvalue
set shell=nothing
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
On Error Resume Next
strKeyPath = "SOFTWARE\Microsoft\Window
strValueName = "TrustPolicy" 'give key to get
strComputer = "."
Const HKEY_LOCAL_MACHINE = &H80000002
dim shell
set shell=createobject("wscrip
Set oReg=GetObject("winmgmts:{
strComputer & "\root\default:StdRegProv"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyP
'WScript.Echo "strvalue" & strvalue
shell.run "test.bat " & strvalue,0
set shell=nothing