Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7050523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:09:14+00:00 2026-05-28T03:09:14+00:00

in the registry ther is a key, which has only value, the (Default) value.

  • 0

in the registry ther is a key, which has only value, the (Default) value. This default entry has a value what i need. I found a script to read the registry values.

const HKEY_LOCAL_MACHINE = &H80000002
const RegistryLocation   = "SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Xcelsius\Keycodes"

ReadRegistry( RegistryLocation )

Function ReadRegistry( RegistryLocation )

strComputer = "."

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

oReg.EnumValues HKEY_LOCAL_MACHINE, RegistryLocation, arrValueNames, arrValueTypes

    Wscript.Echo "Key Name: " & arrValueNames(0)
'RegKeyName = arrValueNames(0)

oReg.GetStringValue HKEY_LOCAL_MACHINE, RegistryLocation, arrValueNames(0), strValue
Wscript.Echo "Value: " & strValue
'RegKeyValue = strValue

'ChangeRegistryValue RegistryLocation, arrValueNames(i), NewSerial

End Function 'ReadRegistry

It works fine IF there are more keys. If only the (Default) value exists, i get a type mismatch error. If i create a new key, then i can read the default entry value.

So my question is, what i am doing wrong, and how should i do it?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:09:15+00:00Added an answer on May 28, 2026 at 3:09 am

    It seems that VBScript has problems with getting an array of ValueNames when there is only one value with empty name. You can read the default value without enumerating value names – just supply empty string for the value name:

    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
    oReg.GetStringValue HKEY_LOCAL_MACHINE, RegistryLocation, "", strValue
    Wscript.Echo "Value: " & strValue
    

    It works in both cases: when default value is the only value and when the are more values under the given key.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've stumbeld upon this registry key but haven't found any documentation what it does.
I have a little app which reads registry key string values. It works well
I have a registry value which is stored as a binary value (REG_BINARY) holding
Is there any registry key which i can look for wcf 4.0
I have created a Registry class in .NET which is a singleton. Apparently this
By default : Registry has been disabled So i get registry editing has been
I want to Read from Registry the Name.how i can do this using VC++
I need to acquire registry path by it's handle in runtime. For this, I'm
Look at this registry key: [HKEY_CURRENT_USER\System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick\OEM\VID_0079&PID_0011] OEMName=USB Gamepad OEMData=hex:00,00,00,10,0a,00,00,00 As you can see, there
Need to Create a Registry Key using bat file.Can I create Reg Key using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.