Sign in to follow this  
Followers 0
Pook

RegRead Help

5 posts in this topic

I'm not 100% sure how to use the RegRead command. If the main key below doesn't exist or just doesn't have a value Then how would you make the script check a different Reg key?

*kinda like a If/Else command in Vbscript

(main Key)

$username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon','AltDefaultUserName')

(back-up Key)

$username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration','UserName')

Share this post


Link to post
Share on other sites



I'm not 100% sure how to use the RegRead command. If the main key below doesn't exist or just doesn't have a value… Then how would you make the script check a different Reg key?

*kinda like a If/Else command in Vbscript

(main Key)

$username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon','AltDefaultUserName')

(back-up Key)

$username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration','UserName')

what's the problem ? (post the part of script that does not func right)

RegRead ( "keyname", "valuename" )

example:

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")
MsgBox(4096, "Program files are in:", $var)

Share this post


Link to post
Share on other sites

what's the problem ? (post the part of script that does not func right)

I think the OP's question its clearly defined ...


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I think the OP's question its clearly defined ...

ok

Return Value

Success: Returns the requested registry value. @EXTENDED is set to the type of the value $REG_... . These types are defined in the "Constants.au3" include file. 
Failure: Returns "" and sets the @error flag: 
 1 if unable to open requested key 
 2 if unable to open requested main key 
 3 if unable to remote connect to the registry 
 -1 if unable to open requested value 
 -2 if value type not supported

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