vegaslaptop Posted July 19, 2005 Posted July 19, 2005 Hello everyone,I am trying to read the reg value for a certain key. $var = RegRead("HKEY_USERS\S-1-5-21-2041921852-553933441-806110124-10729\Environment", "Something") $var1 = RegRead("HKEY_USERS\S-1-5-21-2041921852-553933441-806110124-10729\Environment", "Something1") MsgBox(4096, "Program files are in:", $var) MsgBox(4096, "Program files are in:", $var1)Now I read the values fine and my program works fine on my local machine. BUT the path changes with every machine. e.g.HKEY_USERS\S-1-5-21-2041921852-553933441-806110124-10729\Environmentchanges to something likeHKEY_USERS\S-1-5-21-2041921852-553933441-806110124-104070\EnvironmentEverything remains the same except the middle part of the path in registry. Is there an easy way to search for this key path and thus assign a variable? Or is there a way to set a wildcard for the middle part of the registry path? All inputs are very appreciated.
/dev/null Posted July 19, 2005 Posted July 19, 2005 Now I read the values fine and my program works fine on my local machine. BUT the path changes with every machine. e.g.It's not changing with the machine, but with the user you are logged in. BTW: On a different machine, the SID of the same username will be different. That's the reason why it does not work on another computer.Obviously you want to read the environment variables of a user. So, better use EnvGet() and EnvSet() instead of reading the registry. CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
vegaslaptop Posted July 19, 2005 Author Posted July 19, 2005 (edited) Thank you I will try it. YES IT WORKS! THANK YOU! Edited July 19, 2005 by besnia
bobbintb Posted October 20, 2009 Posted October 20, 2009 i know this is an old thread but i am in the same boat but dont know which variable to search for. i tried envget("SID") and envget("USER"). nothing in the windows list of variables seems to work.
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