jero1987 Posted April 24, 2007 Share Posted April 24, 2007 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 Link to comment Share on other sites More sharing options...
Tripredacus Posted April 24, 2007 Share Posted April 24, 2007 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. Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
jvanegmond Posted April 24, 2007 Share Posted April 24, 2007 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 github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now