hpops
asked on
Query registry key and output results to a log file
This should be an easy one but I'm having trouble with it.
This script is working for me, however I need to have a log file generated on the value it finds in the registry. The value is a "Mutli-string" key.
I have a way to run this at login and would like the script to append the results it finds to a network server. I'd also prefer it create the log file if it did not exist otherwise append to it.
Thanks for any help with this one
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{ impersonat ionLevel=i mpersonate }!\\" &_
strComputer & "\root\default:StdRegProv" )
strKeyPath = "SYSTEM\Setup"
strValueName = "OEMDuplicatorString"
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyP ath,_
strValueName,arrValues
For Each strValue In arrValues
StdOut.WriteLine strValue
Next
This script is working for me, however I need to have a log file generated on the value it finds in the registry. The value is a "Mutli-string" key.
I have a way to run this at login and would like the script to append the results it finds to a network server. I'd also prefer it create the log file if it did not exist otherwise append to it.
Thanks for any help with this one
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{
strComputer & "\root\default:StdRegProv"
strKeyPath = "SYSTEM\Setup"
strValueName = "OEMDuplicatorString"
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyP
strValueName,arrValues
For Each strValue In arrValues
StdOut.WriteLine strValue
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks!
ASKER