Needing vb script help and solution

I do not know scripting, so-
Have looked at many samples people online have provided and finally have a sript that gives me what I am trying to collect and write to a db.
Need HKCU\Network subkeys and  stringvalueName RemotePath and its' value. For example what I want would be   L:  and \\servername\path(share)
The attached has more code probably than needed, but it does give me a drive letter and the path. I did not write this but used  what I could find to get to this point.
 Problem is the second part of the script where it needs to write to the db.   It either writes one line of data or only one part of.  
I do not know what needs to be entered  as I will also get invalid data type.
Also, instead of getting all of the mapped drives ( which it does get and echo so I am sure), it also appears I am only getting the last.
The part to write to the db is fairly standard :

'Create Inventory data block. Here assumption is that the data class with below guid is already configured on server
dim objDCInstance
set objDCInstance = nse.AddDataClass ("{e30cf469-1720-4452-b3bc-7248d42a861a}")

dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)

 
'Add a new row
dim objDataRow
set objDataRow = objDataClass.AddRow
'Set columns
objDataRow.SetField 0,  what is the data that goes here?  Name?    

objDataRow.SetField 1,  what is the data that goes here? Name?  
 
nse.SendQueued

For example. another custom inventory that is working uses
  dwValue for SetField 0

'Add a new row
dim objDataRow
set objDataRow = objDataClass.AddRow
'Set columns
objDataRow.SetField 0, dwValue

nse.SendQueued
FINAL_COPYSimpler-case-getting-the-s.txt
ptbuzzcutNetwork Admin/Tech specialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sirbountyCommented:
Removed a lot of the excess, assuming you didn't need it.
See if this accomplishes what you're after.
Const HKEY_CURRENT_USER   = &H80000001
strComputer = "." ' Use . for current machine
strKeyPath = "Network"

Dim objDCInstance : set objDCInstance = nse.AddDataClass ("{e30cf469-1720-4452-b3bc-7248d42a861a}")
Dim objDataClass : set objDataClass = nse.AddDataBlock (objDCInstance)
dim objDataRow 
Dim oReg : Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
oReg.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubKeys

For Each strSubkey In arrSubKeys
    set objDataRow = objDataClass.AddRow
    strSubKeyPath = strKeyPath & "\" & strSubkey
    strValueName = "RemotePath"
    oReg.GetStringValue HKEY_CURRENT_USER, strSubKeyPath, strValueName , strValue 
    wscript.echo strSubkey & ": = " & strValue
    objDataRow.SetField 0,  strSubKey
    objDataRow.SetField 1,  strValue
    nse.SendQueued
next

Open in new window

1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ptbuzzcutNetwork Admin/Tech specialistAuthor Commented:
Thank you for this.  Working perfectly
0
sirbountyCommented:
Glad I could help. :^)
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

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.