Jump to content

Read registry key


Recommended Posts

I am trying to do a simple script to display a registry key. i am trying the read the following key

HKEY_CURRENT_USER\Software\Smith Micro\VZAccess Manager-Verizon Wireless(Lenovo)

The the actual part of the script is :

$var = RegRead("HKEY_CURRENT_USER\Software\Smith Micro\VZAccess Manager-Verizon Wireless(Lenovo)", "DeviceESN")

MsgBox( 4096,"ESN Number", $var)

I just get a blank message box. I think the problem is with the .....(Lenovo) it is gagging on the ( ).

Any body have any suggestions. Thanks for your help in advance.

Link to comment
Share on other sites

lets do some error checking real quick, see what RegRead says the error is.

Try this, and check the help file for what the errors are.

$var = RegRead("HKEY_CURRENT_USER\Software\Smith Micro\VZAccess Manager-Verizon Wireless(Lenovo)", "DeviceESN")
  If @error Then 
 MsgBox(0,"Error","Error is "&@error)
  Else
 MsgBox( 4096,"ESN Number", $var)
Endif

Edit: Changed code to only show one messagebox

Edited by Kerros

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

lets do some error checking real quick, see what RegRead says the error is.

Try this, and check the help file for what the errors are.

$var = RegRead("HKEY_CURRENT_USER\Software\Smith Micro\VZAccess Manager-Verizon Wireless(Lenovo)", "DeviceESN")
  If @error Then 
 MsgBox(0,"Error","Error is "&@error)
  Else
 MsgBox( 4096,"ESN Number", $var)
Endif

Edit: Changed code to only show one messagebox

Link to comment
Share on other sites

I get an error of 1 " unable to open requested key" So it is not reading the key.

I tried doing what LAR suggested below (copy key name" and it worked. I know my

typing of the key was correct cause I had my partner checkit for me. So it must be

some thing the copy keyname function. ???

Any way you are right --- I should looked at error code square one.

Thanks for you help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...