Sign in to follow this  
Followers 0
jero1987

File Exists With Registry Entries

3 posts in this topic

Is there anyway if i can do a logical check if a registry entry exists or not? Im not sure if i can do this with the FileExists function or not?

Thanks guys

James

Share this post


Link to post
Share on other sites



I believe you can set a var to a RegRead result. Example:

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")

so then you can do a

if $var = expectedResult then

RegWrite

or whatever you need to do.

Share this post


Link to post
Share on other sites

RegRead failure behavior:

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