Sign in to follow this  
Followers 0
isma1949

Read registry key

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

Did you type the...

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

or use RightClick / Copy Key Name?

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0